views:

41

answers:

1

I have 2 web sites with the identical web service. For web service "SampleService", I would like to know how to choose which web server to choose from. Web service: "SampleService" Web reference "SampleWebReference"

Web service url: site 1: http://www.samplesite.com Site 2: http://www2.samplesite.com

Need: Through code, how do I change which site the web reference references based on user selection?

+3  A: 

Click on your web service and in the properties window set the URL behaviour to Dynamic.

Then to set the url in code:

SampleWebReference reference = new SampleWebReference();
reference.Url = "http://www2.samplesite.com";
GenericTypeTea
plus one for tea
Stuart Dunkeld