Donna
Donna

Reputation: 1

How can I use one source file in multiple web services projects?

I have the need to create two web services. They do the same thing, but one has web references to "testing" services. The other has reference to "live" services.

I'd like to create and maintain one set of source (.asmx) files using c# in Visual Studio 2010.

I've managed to create a solution which contains two web service projects. I even managed to reference (using Add Link) the same set of source files in each project.

However, when I go to call the asmx file, the web service, the file's not found and I cannot figure a way to distinguish which service I am calling; the asmx files only exist in the common folder area, not actually within each project.

Upvotes: 0

Views: 391

Answers (1)

John Saunders
John Saunders

Reputation: 161831

If the testing and the live services use the same WSDL, then you do not need separate web references. Use a single reference, then set the Url property of the proxy class to point to the correct service.

Upvotes: 2

Related Questions