views:

186

answers:

1

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/"&gt;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 was expecting HTTP?

The error:

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

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.

Garett
I originally added the service using https : //ogserv.domain.co.uk/ogwsrv/og.asmx?WSDL the WSDL file contains the code shown above which says its located at HTTP:// . There is nothing at the HTTP:// address as its HTTPS only.Hence the error being thrown when the code tries to access the proxy.
Chris M
If you paste the URL into internet explorer. What do you get?
Garett
If i paste the http:// domain in I get bad domain as its HTTPS only."Oops! Google Chrome could not connect to etc" + Sorry for the slow reply
Chris M
Acutally, I meant paste it with HTTPS, as in https://ogserv.domain.co.uk/ogwsrv/og.asmx?WSDL. You shoud get a WSDL file with an HTTPS location in the service address. If not then I would look into how the web service was created.
Garett
I'll mark it as the right answer; I've submitted a bug to the moronic outsourcing (India) company who wrote it. The test environments are all http... get the feeling they didn't think and didnt bother to test.
Chris M