Steffen Jørgensen
Steffen Jørgensen

Reputation: 312

Consume SOAP based web service with https

I'm integrating af ASP.NET application, which must consume a 3rd party SOAP web service, which can only be accessed by HTTPS. I add a service reference i VS2012 with the HTTPS URL and VS find the service just fine. But when I use the proxy that VS create to use the web service, it uses regular HTTP.

I suspect that I should alter the binding in the web.config, but I can't seem to figure out what to do. How do I set up the web service to use HTTPS?

Upvotes: 1

Views: 7119

Answers (1)

Bogdan
Bogdan

Reputation: 24590

You need to make sure that the binding the client uses has security mode="Transport" set up (and that the client binding matches the server binding), something like this for example:

<binding name="yourClientSecureBinding">
    <security mode="Transport">
        <transport clientCredentialType="None"/>
    </security>
</binding>

and that the client indeed accesses the httpS:// address of the web service:

<client>
    <endpoint bindingConfiguration="yourClientSecureBinding" 
              address="https://..."  
              ... />
</client>

You are not providing any code, so for starters have a look at these posts: here (Microsoft developer network - Transport Security with an Anonymous Client) and here (Https with BasicHTTPBinding).

Upvotes: 6

Related Questions