在 ServiceModel 客户端配置部分中,找不到引用协定

<system.serviceModel>

<bindings>
<basicHttpBinding>
<binding name="SAPERP_WebServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:6888/SAPERP_WebService.asmx" binding="basicHttpBinding"
bindingConfiguration="SAPERP_WebServiceSoap" contract="ServiceReference1.SAPERP_WebServiceSoap"
name="SAPERP_WebServiceSoap" />
</client>
</system.serviceModel>

查看web.config这里是多了还是少了 或者是没有

另外 调用webservice方法的话 依照你的命名 找到尾缀是"SoapClient"的

Domain.ServiceReference1.SAPERP_WebServiceSoapClient test = new SAPERP_WebServiceSoapClient();
var json = "{\"DATA\":[{\"CODE\":\"01\",\"VALUE\":\"采购方式\",\"FCODE\":\"0\"}]}";
var model = JsonConvert.DeserializeObject<SupCategoryCreateViewModel>(json);
test .AddSupplierCategorys(model);

想着还是写一下吧 以前弄过webservice  后来不常用  这些都有些模糊了 以此写个博客来强化一下记忆

如果不知道怎么去写webservice 可以参考一下这片博客

https://www.cnblogs.com/cr-cool/p/9482894.html

猜你喜欢

转载自www.cnblogs.com/sajiao/p/12036762.html