Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to change the properties of a WebReference in run-time? [duplicate]

I am trying to come up with such a solution that the user is going to enter the URL of a web-service and it is going to be tested.

Although what I want is a URL change, I guarantee the Service Description is always going to be the same (except the wsdl:service tag of course which contains the soap:address); I just want to test different customers, running the same service.

like image 892
tafa Avatar asked Oct 17 '08 09:10

tafa


2 Answers

yes you can. just change the url property of the service proxy before calling any methods on it.

like image 188
Joachim Kerschbaumer Avatar answered Nov 01 '22 06:11

Joachim Kerschbaumer


Yes; every web-service proxy offers a way to do this; with pre-WCF proxies (including WSEx) the address is the Url property on the proxy class - just change it before you do anything interesting with the proxy.

With WCF, I believe you specify the endpoint-address via one of the constructors.

So just generate your proxy from your reference wsdl, and off you go ;-p

like image 28
Marc Gravell Avatar answered Nov 01 '22 07:11

Marc Gravell