[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

"Request for the Permission of type Failed" while deserializing a remoted object

Tomcat

9/23/2004 6:18:00 PM

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.


4 Answers

Ken Kolda

9/23/2004 11:38:00 PM

0

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.
>
>


Tomcat

9/24/2004 12:37:00 PM

0

Hey Ken,
Thanks for taking a look.

the LDAPObject in this case is a simple object that I created. The entire
thing is nothing but a class, denoted as [serialiazable] of course, with a
couple of strings and ints. It is not derived from anything, and contains
no other object types. All-in-all, a very simple object..

Upon your suggestion however, I did try to pass along a non-user defined
object, in this case a System.Collections.ArrayList, and to my amazement
that DID work. So It would seem that I just can't access the objects that I
create.

Hope that answers your questions. Let me know if you need any more data.

--
Tomcat
Michael Rosenstein
Sr. Software Engineer
Applied Visions Inc.



"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:%23uBPqZcoEHA.1088@TK2MSFTNGP09.phx.gbl...
> 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...


Tomcat

9/29/2004 8:53:00 PM

0

I managed to solve the problem, It has to do with the version of the .NET
Framework I was using. It seems that version 1.0 w or w/o SP1 or SP2 works
just fine but when you put on SP3, as available currently from Windows
Update, it fails. I'm not sure why, but it does. If anybody has any ideas,
please let me know. Thanks.

--
Tomcat
Michael Rosenstein
Sr. Software Engineer
Applied Visions Inc.


"Tomcat" <michaelr@avi.com> wrote in message
news:Oiac9MjoEHA.3488@TK2MSFTNGP12.phx.gbl...
> Hey Ken,
> Thanks for taking a look.
>
> the LDAPObject in this case is a simple object that I created. The entire
> thing is nothing but a class, denoted as [serialiazable] of course, with a
> couple of strings and ints. It is not derived from anything, and contains
> no other object types. All-in-all, a very simple object..
>
> Upon your suggestion however, I did try to pass along a non-user defined
> object, in this case a System.Collections.ArrayList, and to my amazement
> that DID work. So It would seem that I just can't access the objects that
> I create.
>
> Hope that answers your questions. Let me know if you need any more data.
>
> --
> Tomcat
> Michael Rosenstein
> Sr. Software Engineer
> Applied Visions Inc.
>
>
>
> "Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
> news:%23uBPqZcoEHA.1088@TK2MSFTNGP09.phx.gbl...
>> 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...
>
>


Simon Law

10/14/2004 5:54:00 AM

0

I have the same problem after installing SP3.

Simon.


"Tomcat" <michaelr@avi.com> wrote in message
news:%23%23jtAZmpEHA.3712@TK2MSFTNGP15.phx.gbl...
>I managed to solve the problem, It has to do with the version of the .NET
>Framework I was using. It seems that version 1.0 w or w/o SP1 or SP2 works
>just fine but when you put on SP3, as available currently from Windows
>Update, it fails. I'm not sure why, but it does. If anybody has any ideas,
>please let me know. Thanks.
>
> --
> Tomcat
> Michael Rosenstein
> Sr. Software Engineer
> Applied Visions Inc.
>
>
> "Tomcat" <michaelr@avi.com> wrote in message
> news:Oiac9MjoEHA.3488@TK2MSFTNGP12.phx.gbl...
>> Hey Ken,
>> Thanks for taking a look.
>>
>> the LDAPObject in this case is a simple object that I created. The
>> entire thing is nothing but a class, denoted as [serialiazable] of
>> course, with a couple of strings and ints. It is not derived from
>> anything, and contains no other object types. All-in-all, a very simple
>> object..
>>
>> Upon your suggestion however, I did try to pass along a non-user defined
>> object, in this case a System.Collections.ArrayList, and to my amazement
>> that DID work. So It would seem that I just can't access the objects
>> that I create.
>>
>> Hope that answers your questions. Let me know if you need any more data.
>>
>> --
>> Tomcat
>> Michael Rosenstein
>> Sr. Software Engineer
>> Applied Visions Inc.
>>
>>
>>
>> "Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
>> news:%23uBPqZcoEHA.1088@TK2MSFTNGP09.phx.gbl...
>>> 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...
>>
>>
>
>