I'm attempting to return from a web service an xml serialized version of an existing business object. However, the design of this object is posing a few challenges for the xml serializer.
1.It forces me to expose a public constructor in all serialized classes. Specifically, I have several classes from where a don't want a default public constructor exposed. 2.It appears to force me to include BOTH get and set methods in any public properties that I want to serialize. Specifically, I have several public properties that are "read-only" and so only expose a getter. I'd prefer to not alter the design of the object to accomodate xml serialization however, I can't seem to find any xml serialization specific decorations to mark the classes with to get around these issues. Questions: 1. Can I do anything (like an xml attribute to mark the class with?) about the requirement for the serialized classes to expose a default public constructor? I'd prefer not to change my existing class design to accomodate xml serialization for exposure via the web service. 2. Can I do anything about the seeming requirement to implement both a get and set method on a public property. (like an xml attribute to mark the property with?) I'd prefer not to accessibility my existing class properties design to accomodate xml serialization for exposure via the web service. 3. I assume that pushing the existing object's data into an xml serialization/web service specific object before is a bad idea. =================================== 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 C# November 29 - December 3, in Los Angeles http://www.develop.com/courses/edotnet View archives and manage your subscription(s) at http://discuss.develop.com