.NET Framework - webservice reference embedded

Asked By redbull on 28-Jun-10 05:15 AM
Hi to all,
is there a way to declare a webservice address inside the code?
If I add a webservice, the address is visible in the app.config but I wanna
avoid it.
Any suggestion? thanks


Barry Flynn replied to redbull on 29-Jun-10 05:37 PM
Not sure if I am addressing your problem or not...

A few years ago (and probably a few versions of VS ago) I wote a dll which
talked to a web service.
The URL of the web service on my machine was different from that of the end
user.

After doing a
Dim lws As New localhost.TheWebService

I could do a
lws.URL = 'whatever'

Is that relevant to your question?
If not, I appologize for wasting your time !

Barry

--------------------
redbull replied to Barry Flynn on 30-Jun-10 04:35 AM
lws As New localhost.TheWebService

Thanks, following your suggestion I solved with:

webservice.Endpoint.Address = New
System.ServiceModel.EndpointAddress("http://www.miosito.eu/service.asmx")

;)