HighTechTalks DotNet Forums  

XmlSerialization of classes with declarative Security

Dotnet Security microsoft.public.dotnet.security


Discuss XmlSerialization of classes with declarative Security in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Doug Holland
 
Posts: n/a

Default XmlSerialization of classes with declarative Security - 02-26-2005 , 02:05 PM






I'm working on a project where I have to pass a serialized object to a
ASP.NET web service and I recieve an exception because that the object cannot
be serialized due to declarative security.

The object in question is an Exception class and as such I cannot change the
declarative security to imperative security permissions or demans in property
accessors because I do not own the code to the Exception class.

The following support article details how to do this in this way.

http://support.microsoft.com/?kbid=326971

Is there a way that I can allow a WebMethod to take an Exception as a
parameter and not recieve the security exception that results from attempting
to serialize a class with declarative security?

Thanks in advance

Doug Holland

Reply With Quote
  #2  
Old   
Nicole Calinoiu
 
Posts: n/a

Default Re: XmlSerialization of classes with declarative Security - 03-01-2005 , 01:25 PM






Not directly, but there are other ways to pass exception information to a
web method. One easy approach would be to pass just the type and message.
A more complex approach would be to use an alternate serializer such as the
BinaryFormatter, then pass the serialized data as, for example, a byte
array.



"Doug Holland" <DougHolland (AT) discussions (DOT) microsoft.com> wrote

Quote:
I'm working on a project where I have to pass a serialized object to a
ASP.NET web service and I recieve an exception because that the object
cannot
be serialized due to declarative security.

The object in question is an Exception class and as such I cannot change
the
declarative security to imperative security permissions or demans in
property
accessors because I do not own the code to the Exception class.

The following support article details how to do this in this way.

http://support.microsoft.com/?kbid=326971

Is there a way that I can allow a WebMethod to take an Exception as a
parameter and not recieve the security exception that results from
attempting
to serialize a class with declarative security?

Thanks in advance

Doug Holland



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.