Ken Kolda
9/23/2004 11:38:00 PM
What kind of Object is LDAPObject -- is it just a simple object made up of
basic types or does it have other classes embedded in it which come from the
Framework? There are some object types which require specific permissions to
be deserialized (e.g. the WindowsIdentity object, which requires
ControlPrincipal permissions).
If that's not it, then I would try to see if this error is specific to the
LDAPObject type or if it's any object you try to pass to the server. Also, I
would try both a type from the Framework, e.g. a DataSet, as well as a type
from your own assembly.
Ken
"Tomcat" <michaelr@avi.com> wrote in message
news:eQKmimZoEHA.1644@tk2msftngp13.phx.gbl...
> Hello Everyone,
>
> I seem to be having this problem that has kept me occupied for almost two
> days, so I'm hoping somebody out there has seenit and has some
suggestions.
> Here's the problem...
>
> I have an application that I am developing which involves a Web Service
> using Remoting to access remoted objects running on a windows service,
> located on the same machine. Both the Web Service and the Windows Service
> include in there solution a third assembly that represents a collection of
> simple objects (i.e. classes that consist of just bools, ints, strings,
> etc.) as well as some other things.
>
> When the Web Service makes a remoted call to the Windows Service, passing
> nothing but basic types like this (passing an int):
>
> LDAPResultStruct ldapResults;
>
> // First get an interface to the LDAP Interface.
> object objLDAPcontrol = Activator.GetObject(typeof(ILDAPInterface),
> m_routingURI);
>
> if (objLDAPcontrol == null)
> throw new LDAPInterfaceInvalidException();
>
> ILDAPInterface ldapInterface = (ILDAPInterface)objLDAPcontrol;
>
> // Call the interface to the LDAP Interface.
> ldapResults = ldapInterface.GetLDAPResults(5);
>
> return ldapResults;
>
> ... It workes Fine. However, if i try to pass an object that is defined
in
> my third assembly (again, which both services include in their solutions),
> Like this:
>
> ldapResults = ldapInterface.GetLDAPResults(ldapObject);
>
> I get the following error:
> "Request for the permission of type Tomcat.SysDB.LDAPObject failed."
> (assuming the namespace of my third assembly is Tomcat.SysDB, and
ldapObject
> is of type LDAPObject).
>
> Further inspection yields that the exception is of type
> System.Runtime.Serialization.SerializationException with an inner
exception
> of type System.Security.SecurityException. What appears to be happening
is
> the Windows Service is denying the remoting call access to this object and
> therefore cannot deserialize the object. While tracing both applications,
I
> find that the Web service makes the call and recieves the exception,
before
> more breakpoint in the windows service is ever reached, i.e. the Framework
> is rejecting my remoted function call before I get it.
>
> I ask anybody with any ideas for any help. I have been fighting this for
> too long and I am quite frustrated. I will be happy to provide anybody
with
> any additional information they might need. Thanks.
>
> Tomcat
> AKA Michael Rosenstein
> Sr. Software Engineer
> Applied Visions Inc.
>
>