Using XmlSerializer for custom data serialization

When transferring custom data objects in a WCF service operation (as parameters or return values), the runtime will serialize the objects into XML elements, which are embedded in the underlying SOAP XML message. By default, WCF runtime uses the DataContractSerializer for serializing the .NET objects into XML or binary content. And the DataContractSerializer does have many advantages for DataContract serialization as compared to the traditional XmlSerializer used in ASMX Web Service. However, sometimes we will prefer using the XmlSerializer for data object serialization in a WCF service. For example, when talking to some non-.NET platform, like a Java-based service or client, using XmlSerializer ...

Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.