Question

If I want to write a web service and expose it as both WCF and basic SOAP, can my data types use only data contract serialization or do I have to use the XmlSerializer?

Microsoft mentions that the XmlSerializer is required

When creating services that follow the legacy SOAP Encoding standard

which may imply this.

Is there a standard technique for creating data types that can be exposed through all bindings?

Was it helpful?

Solution

You can completely ignore the old XML Serializer if you are creating a new service. Just use Data Contract Serialization and the binding will take care of the rest.

OTHER TIPS

I believe you could decorate your types with both data and xml serialization attributes. They will both be applied depending on the context.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top