|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
XmlSerialization of classes with declarative SecurityASP.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 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. Show quoteHide quote "Doug Holland" <DougHoll***@discussions.microsoft.com> wrote in message news:B99CB991-2395-4577-9AE6-64EFB29C932E@microsoft.com... > 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
Medium Level Trust and Reflection
API to access loaded assembly hash Method SetThreadPrincipal Make Security to Directory Windows authentication Encrypting short data w/ asymmetric cipher Forms authentication periodically requires re-login Troubleshoot Caspol System.Security.Permissions.SecurityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, Publi Windows user controls in a web page: Security |
|||||||||||||||||||||||