Operation not supported in the WCF Test Client

前端 未结 4 725
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 13:01

I created a WCF service and to the default service I added another operation contract on the main DataContract:

[OperationContract]
void DoSomething(UserData         


        
4条回答
  •  渐次进展
    2021-01-18 13:44

    The WCF default expectation for a service call is request-response - WCF expects some kind of a response back.

    If you want to use void (as in: no return value), you need to decorate those methods with

    [OperationContract(IsOneWay = true)]
    void DoSomething(UserData data);
    

    to tell the WCF runtime not to expect any return value from the call

    Read more about WCF: Working with One-Way Calls, Callbacks and Events here in MSDN Magazine.

提交回复
热议问题