Thursday, July 14, 2011

Add service reference in visual studio for password protected services

Visual Studio does not directly allow to add web reference to password protected secure webservice and it will throw error like you have mentioned. But you can still add web reference to secure webservice by using 2 techniques.

Browse the webservice wsdl in a browser. It will prompt for security login and provide the username/password. Then save the WSDL xml into a file in your local computer.
Then add web reference to this local version of wsdl. In this way, you will be able to add web reference to secure password protected webservice using visual studio.

2 comments:

  1. How can i do this "Then add web reference to this local version of wsdl"

    I cannot see any option to browse this file in visual studio add reference dialog.

    ReplyDelete
  2. i cannot browse the wsdl in a browser - it does not prompt for security login, just refuses the authorization.

    ReplyDelete