• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Refering to alternate web service should one not be available


Hi all

I am writing a system which a frint end vb .net program access and uses a web service on a local web server. But if that web server is not availbale then i need the program to be able to dynamically( or be done with user interaction) point to another (copy of web service) on another web server in house

I think this can be done but anyone any tips on how to go about this


cheers

davoman
0
davoman
Asked:
davoman
  • 2
  • 2
1 Solution
 
eekjCommented:
Change the url in the proxy, as long as the two web services are identical should be sweet
0
 
davomanAuthor Commented:
Can you do that programmatically
0
 
eekjCommented:
'In your proxy ... make it accept the Url as a parameter
public Sub New(Byval Url as String)
      Me.Url = Url; ' "http://localhost/YourWebService1.asmx"
End Sub

' ... in code:
Dim Server as YourWebServiceProxy
try
      Server = new YourWebServiceProxy("http://localhost/YourWebService1.asmx")
      ' ...
catch (byval e as Exception)
      Server = new YourWebServiceProxy("http://localhost/YourWebService2.asmx")
      ' ...
End Try
0
 
davomanAuthor Commented:
Just the job thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now