3

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?

user1365247
  • 337
  • 7
  • 17

4 Answers4

4

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.

Stefano Altieri
  • 4,550
  • 1
  • 24
  • 41
2

Use SoapUI to mock the services for dev

Yaakov Ellis
  • 40,752
  • 27
  • 129
  • 174
1

You can use wsdl.exe to generate your client classes, which you can then add to your project, you will need access to a windows machine on which you can run it.

Justin Harvey
  • 14,446
  • 2
  • 27
  • 30
1

Simply create a Visual Studio Web Project with a web service and add it to your solution. After this you can set your reference to Web project and develop with it.

Kai
  • 1,953
  • 2
  • 13
  • 18