查看添加的服务地址是不是https开头的,而 *.config 文件里面自动添加的链接变成了http,当前的bindbing类型为basicHttpBinding,
解决方法:在config文件里面手动将链接的http变为httpps, binding类型变成basicHttpsBinding既可。
下面是一个demo:
1 <?xml version="1.0" encoding="utf-8" ?> 2 <configuration> 3 <startup> 4 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> 5 </startup> 6 <system.serviceModel> 7 <bindings> 8 <basicHttpsBinding> 9 <binding name="INF_AXATAWSSoap" /> 10 </basicHttpsBinding> 11 </bindings> 12 <client> 13 <endpoint address="https://www.xxxx.com/WSAXA/WebServices/INF_AXATAWS.asmx" 14 binding="basicHttpsBinding" bindingConfiguration="INF_AXATAWSSoap" 15 contract="Api.INF_AXATAWSSoap" name="INF_AXATAWSSoap" /> 16 </client> 17 </system.serviceModel> 18 </configuration>