之前一直用winform直接訪問的是aspx,現在改成了webservice,用瀏覽器可以正常打開https開頭的WSDL的url,把這個添加參考,啟動winform就會報錯,測驗了好多原因才發現不支持https,改成http即可正常
看了下xml最后兩行自動生成的參考地址也是http而不是https
把這個xml保存下來放在服務器上,手動修改xml中http為https, app.config也手動修改為https,---可能這個是我異想天開的方式,可正常添加參考,但是只要啟動后也是一樣失敗。
簡單說:似乎不支持https?但是百度看了下也有不少是使用https方式的webservice……
uj5u.com熱心網友回復:
wsdl自動生成的最后參考也是http<wsdl:service name="WebService">
<wsdl:port name="JXCWebServiceSoap" binding="tns:WebServiceSoap">
<soap:address location="http://www.baidu.com/wbc/WebService.asmx"/>
</wsdl:port>
<wsdl:port name="WebServiceSoap12" binding="tns:WebServiceSoap12">
<soap12:address location="http://www.baidu.com/wbc/WebService.asmx"/>
</wsdl:port>
</wsdl:service>
uj5u.com熱心網友回復:
搞定了
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/259358.html
標籤:C#
