In what case svcutil.exe decides to apply XmlSerializerFormatAttribute in generated proxy code?

StackOverflow https://stackoverflow.com/questions/14317126

質問

As in title in what case svcutil.exe decides to apply XmlSerializerFormatAttribute in generated proxy code? I can't find any documentation about that so I'd be grateful for linking some sources.

役に立ちましたか?

解決

The XmlSerializer is chosen (and the XmlSerializerFormatAttribute is applied) whenever the schema of the web service is not compatible with DataContractSerializer. As user "Aphelion" pointed out in their answer, one case when this can happen is when using some legacy ASMX web services. However, it is also quite common to see this when interoperating with non-.NET services (for example, Java-based). The definitive document here is actually http://msdn.microsoft.com/en-us/library/ms733112.aspx , which tells you exactly what is and isn't supported in the schema.

他のヒント

The XmlSerializerFormat is used to support backwards compatibility with ASMX (Classic web services).

By default, the proxy will use the DataContractSerializer. If the schema elements in the WSDL document use XSD schema features that the DataContractSerializer is unable to handle, it will pick the XmlSerializer.


I can recommend 'Learning WCF' by Michele Leroux Bustamante for some in-depth examples.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top