views:

143

answers:

2

In a fairly standard fashion, I created a Web Reference to a SOAP service in Jira for an extension that I'm building (Jira is an issue tracker for those unfamiliar with it). Visual Studio auto-generates a .Settings file and an app.config that contains the web service URL.

Since I'm developing an extension/plugin to an ALM product we're building, the consumer of the extension will be the one who ultimately decides where this web service points to, because it will be integrated with the consumer's instance of Jira. Assume that the web service URL would be stored and pulled from a database.

How can I get the auto-generated service to use a URL from a database instead of from the generated app.config?

Note: we are using v2.0 of the framework, so WCF is not an option.

+4  A: 

Even in the 2.0 web service you should be able to change the "Url" property of your web service proxy to the value you desire.

Otávio Décio
Face, meet palm. I can't believe I missed this property...
John Rasch
@John - don't sweat over it, man. We've all been there.
Otávio Décio
A: 

Use the constructor of the client that admits the uri.

Pablo Castilla
It didn't seem to be in the constructor, I had to use the Url property as suggested by Otávio
John Rasch
You have it in the constructor, but it is easier doing it with the url property as Otavio suggested:HelloWorld.HelloWorldClient hello =newHelloWorld.HelloWorldClient("BasicHttpBinding_IHel loWorld",newEndpointAddress("http://localhost:8888/BasicHost/HelloWorld"));
Pablo Castilla