Add Web Reference with certificates on https

Today I was adding a webservice via "Add Web Reference" to my project. The webservice was only accessible on https with a client certificate. When I did "Add Web Reference" I got a "The underlying connection was closed: Could not establish secure channel for SSL/TLS", but in IE it's works perfect. After some research I found an other way to add the webservice via "Add Web Reference". You can do it like this:

  1. Save the WSDL to a location on your machine.
  2. Copy the path.
  3. Go to the Add Web Reference in your project. 
  4. Paste the path you copied into the URL.
  5. Click on Go.
  6. Click on Add Reference

Don't forget to change the webservice url in your Web.config or App.config.

1 Comment

  • In many cases the WSDL also contains references to other WSDLs/XSDs using the xsd:import or xsd:include elements. In such cases it is also required to copy the referenced files and change the referencing WSDL to reflect their new local path.

Comments have been disabled for this content.