查看添加的服務地址是否是https開頭的,而 *.config 文件裏面自動添加的連接變成了http,當前的bindbing類型爲basicHttpBinding,spa
解決方法:在config文件裏面手動將連接的http變爲httpps, binding類型變成basicHttpsBinding既可。code
下面是一個demo:xml
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>