
web service and updating web reference with vb.net design time vs run time
Hi,
I had the exact same issue.
I noticed that every web service has a URL property, so all you need to
do is instantiate the web service, set the URL from a setting in your
app.config file (or the registry if you wanted to) and away you go.
This way clients can change the app.config to point to a different URL
that hosts the same web service if one of your servers go down.
Here is the code from my app...>
' instantiate a copy of my web service
Dim w As New HcsServices.main
Try
' set the url from my app.config file
w.Url = _
system.Configuration.ConfigurationSettings.AppSettings.Item("WebServices
")
' call my web service method
IP = w.GetIPAddress
' error handler
Catch ex As Exception
' if it didnt work pass some useful information to the error
log
Dim strErr As String = "Web Service Error in
frmSettings.btnGetIP_Click URL:" & w.Url
WriteToLog.Invoke(strErr & ControlChars.CrLf & ex.ToString,
EventLogEntryType.Error)
*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!