Why does WCF sometimes add “Field” to end of generated proxy types?

前端 未结 5 2124
夕颜
夕颜 2021-02-04 05:11

Basically, I have a server-side type \"Foo\" with members X and Y. Whenever I use Visual Studio\'s \"Add Server Reference\" then I see the WSDL and the generated proxy both appe

5条回答
  •  离开以前
    2021-02-04 05:43

    I had this problem too, but from the client I was still getting Field at the end of the class members even after making the mentioned change at the interface.

    The problem was, I was using a DataContractSerializer to work with disk file serialized requests (during the test of our service, we were getting serialized requests from the provider, to be able to debug before going live).

    After changing the DataContractSerializer to a XmlSerializer, specifying on its constructor the root element (by a typeof() call) and the rootnamespace (because by default, XmlSerializers write the standard namespace), I could deserialize the requests and work perfectly with the WCF Service.

    Hope this helps somebody. I lost soooo many time with this "issue".

提交回复
热议问题