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

前端 未结 5 2125
夕颜
夕颜 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:42

    I had the same issue, and sergiosp's answer got me headed in the right direction. Just adding some additional info to hopefully help someone else.

    Adding [System.ServiceModel.XmlSerializerFormatAttribute()] to the interface, and re-generating the client code resolved the problem for me.

    public interface IMyService
    {
        [System.ServiceModel.XmlSerializerFormatAttribute()]
        [System.ServiceModel.OperationContract]
        recordResponse GetRecord(recordRequest request);
    
    }
    

提交回复
热议问题