开发者

Consuming a HTTPS Web Service in .Net 3.5 Web Project

I'm trying to consume a webservice that ONLY runs on HTTPS but using the "add service" method in VS or using the WSDL to generate a code file leaves me with a web service that states its http...

  <wsdl:service name="OGServ"> 
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">XML Web Services element of OGServ Gateway</wsdl:documentation> 
    <wsdl:port name="OGServSoap" binding="tns:OGServSoap"> 
      <soap:address location="http://ogserv.domain.co.uk/ogwsrv/og.asmx" /> 
    </wsdl:port> 
    <wsdl:port name="OGServSoap12" binding="tns:OGServSoap12"> 
      <soap12:address location="http://ogserv.domain.co.uk/ogwsrv/og.asmx" /> 
    </wsdl:port> 
  </wsdl:service> 

Would this be the reason that even when I change the app.config (generated by the add-service) endpoint address to https it says it开发者_StackOverflow社区 was expecting HTTP?

The error:

EC.Tests.OGGatewayLayerTest (TestFixtureSetUp):
System.ArgumentException : The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via


When you add the web service to your project use the "https" URI scheme. This will generate a WSDL file with the proper location attribute. Something along these lines:

https://ogserv.domain.co.uk/ogwsrv/og.asmx?WSDL

If you manually edit the WSDL then your changes will be overwritten when you use the "Update Service" option in Visual Studio.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜