7

I'm running a C# web service in IIS6 and trying to get it to work over SSL. When doing a tcpdump it shows the initial call as https but every other call over http. My SSL certificate is self signed and https works fine in my web browser. I'm using PHP SoapClient for the client.

Does anyone know what would cause this?

In the wsdl the address location is set to http. Should this be https? How do I change it?

<wsdl:service name="Service">
<wsdl:port name="BasicHttpBinding_Service" binding="i0:BasicHttpBinding_Service">
<soap:address location="http://example.com/Service.svc"/>
</wsdl:port>
</wsdl:service>
John Saunders
  • 160,644
  • 26
  • 247
  • 397
Eggo
  • 71
  • 1
  • 2

1 Answers1

10

You must configure your service to use HTTPS:

<bindings>
  <basicHttpBinding>
    <binding name="https">
      <security mode="Transport" />
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="metadata">
      <serviceMetadata httpsGetEnabled="true" />  
    </behavior>
  </serviceBehaviors>
</behaviors>
<services>
  <service name="..." behaviorConfiguration="metadata">
    <endpoint address="..." contract="..." binding="basicHttpBinding"
              bindingConfiguration="https" />
  </service>
</services>

This will allow calling your service only over HTTPS because there is no unsecured endpoint exposed. WSDL will also be accessible only over HTTPS because HTTP GET is not enabled.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • 1
    Nobody answered OPs another question: In the wsdl the address location is set to http. Should this be https? How do I change it? Please let me know, if the above changes to config file also changes the address location to https? Is it something required? – WinFXGuy Nov 23 '12 at 17:06
  • @WinFXGuy: The address location in WSDL should be HTTPS as well. If it is not you have some additional configuration problem. – Ladislav Mrnka Nov 23 '12 at 18:00
  • Am I missing anything? Please refer to my question: http://stackoverflow.com/questions/13502185/why-my-wsdl-still-shows-basic-http-binding-with-the-location-value-of-http – WinFXGuy Nov 23 '12 at 18:25