SoapRpcMethod.OneWay相关

为服务中的方法添加OneWay属性后,vs所自动产生的代理类会为代理方法添加
System.Web.Services.Protocols.SoapRpcMethodAttribute,代替以往的System.Web.Services.Protocols.SoapDocumentMethodAttribute

使用OneWay的方法生成的代理类代码片断
  [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://tempuri.org/SomeMethod", RequestNamespace="http://tempuri.org/", OneWay=true)]

没有使用OneWay的方法生成的代理类代码片断
  [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SomeMethod", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]


所以如果客户端曾经引用过该web服务,就需更新web引用,否则会在使用时引发异常

原文地址:https://www.cnblogs.com/stswordman/p/441952.html