Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add reference to webservice

I am developing a project using Visual Studio 2010, and I need to consume a webservice. The problem is that the development machine does not have access to the webservice, so I cannot add a reference directly.

What I need is to include a stub in my project that is exactly the same structure like the webservice. Once I deploy the project on the live server I will then be able to simply change the URL in the web.config and point it to the real webservice.

How can I achieve this?

like image 660
user1365247 Avatar asked May 08 '26 02:05

user1365247


1 Answers

Get the webservice wsdl, then execute the Visual Studio command prompt and wsdl.exe description.wsdl

This generate a cs proxy file that you can add to your solution and use.

like image 154
Stefano Altieri Avatar answered May 10 '26 14:05

Stefano Altieri