R
Roland Wolters
Hi,
My WebSite uses a webservice to get some data. Problem is that the url for
the webservice is different when it is running on de webserver than when it
is running localy, when it is built.
When the website needs the webservice I read the correct url from the
config file and change the url property. That works fine. That is, the
first time I get an error. Of course I can catch the error but how can I
prevent this?
Here is the code:
SiteDataService.SiteData objSiteData=new SiteDataService.SiteData();
objSiteData.Url=ConfigurationSettings.AppSettings["WebServiceURL"];
The first time these lines run it throws an error "The underlying
connection was closed: An unexpected error occurred on a send" wich is
correct because the url in the build is not a public url.
How can I do this in a correct way?
Greetings,
Roland
My WebSite uses a webservice to get some data. Problem is that the url for
the webservice is different when it is running on de webserver than when it
is running localy, when it is built.
When the website needs the webservice I read the correct url from the
config file and change the url property. That works fine. That is, the
first time I get an error. Of course I can catch the error but how can I
prevent this?
Here is the code:
SiteDataService.SiteData objSiteData=new SiteDataService.SiteData();
objSiteData.Url=ConfigurationSettings.AppSettings["WebServiceURL"];
The first time these lines run it throws an error "The underlying
connection was closed: An unexpected error occurred on a send" wich is
correct because the url in the build is not a public url.
How can I do this in a correct way?
Greetings,
Roland