user1365247
user1365247

Reputation: 337

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?

Upvotes: 3

Views: 153

Answers (4)

Kai
Kai

Reputation: 2013

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.

Upvotes: 1

Justin Harvey
Justin Harvey

Reputation: 14682

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.

Upvotes: 1

Stefano Altieri
Stefano Altieri

Reputation: 4628

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.

Upvotes: 4

Yaakov Ellis
Yaakov Ellis

Reputation: 41550

Use SoapUI to mock the services for dev

Upvotes: 2

Related Questions