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