asp.net - How to change web service URL dynamically or easily? -
i have few web service references in asp.net vb web application .net 4 , using vs2010. 1 of them wcf service (i think has .svc @ end) , 2 of them .asmx services. have change them quite change different environment such development, test, production. right click on service reference (.svcmap file) , choose configure service reference. update service reference , web.config. override binding setting such maxreceivedmessagesize="2147483647" have put in web.config every time change url.
i wondering if there easier way change url doing. have seen similar posts on setting url behaviour = dynamic don't have option in mine , don't know why.
with .net 4, looks proxy class has constructor takes useful parameters. try instantiating proxy class this:
myservice.foosoapclient foo=new myservice.foosoapclient("myservicesoap",myurl);
the myservicesoap name comes app.config file. name property in <client> <endpoint ... name="myservicesoap" />
tag.
Comments
Post a Comment