I have a simple .net container object that represents a standard xml
response from a webmethod that can contain exceptions, validation responses
and results. I know the WS frame automatically handles serialization of
exceptions to soapExceptions but in order to provide a consistent container
to a client. I'd like to be able to catch any exceptions and stuff them in
the container before returning it to the client.
public class ResponseMessage
{
public Result Results;
public MessageList Messages;
public Exception Exception;
}
I get the following error.
The property 'TargetSite' on type 'System.Exception' cannot be serialized
because it is decorated with declarative security permission attributes.
Consider using imperative asserts or demands in the property accessors.
Question: Is what I'm trying to do a good idea. Returning a consistent xml
response message to the client perspective? From the research I've done it
is. Should just generate a SoapException directly?
===================================
This list is hosted by DevelopMentor� http://www.develop.com
Some .NET courses you may be interested in:
Essential .NET: building applications and components with CSharp
August 30 - September 3, in Los Angeles
http://www.develop.com/courses/edotnet
View archives and manage your subscription(s) at http://discuss.develop.com