WebSvc Failback!

  • Thread starter Thread starter Vai2000
  • Start date Start date
V

Vai2000

Hi All, I have a box outside the DMZ that calls my WebSvc 's. I have 2 boxes
running the WebSvc's though one is like backup (so both don't run
concurrent).
Incase of outage when the first box is not responding I want to call the
WebSvc from the Box No.2
How do I accomplish that..?

Q. How can I detect that my WS on Box1 is down?
Q how can I call WS from Box2?

For now...I have made the property of WS to be dynamic and the WSDL is in
the Web.config of the Caller.


TIA
 
Vai2000,

Personally, I think that this is something that should be handled in
hardware. Basically, you would set up a web farm, and the hardware
servicing the request would be responsible for determining which machine
would service it, based on availability (in which case an outage would mean
there is none for that one machine).

However, if you must do this in software on the call side, I would just
wrap the call in a try/catch block, and if an exception occurs (which
indicates the machine is down), I would make the call again, making sure
that the service that the proxy is pointing to is the one on the backup
machine.

Hope this helps.
 
In case the 'switching' part is not clear...

Make the web reference static, and point it towards the
first web service. If that call fails, simply change the
URL property of the web service proxy to point to
your 'fallback' web service and try again.

Also note that you can use the Timeout property of your
web service proxy to control how long you wait for the
first web service to return before trying the second one.
The proxy will throw a System.Net.WebException with a
message of 'The operation has timed-out.' if the time is
exceeded.

Good Luck,
John Bendiksen
 
I agree - I don't think this is something that should be handled by the
client calling the service.

Handling it in hardware would be ideal, however most network hardware that
will do this sort of failover is very expensive. Depending on what OS these
two systems are running on, you may wish to look into the Network Load
Balancing Service in Windows. This is available in the standard edition of
Windows Server 2003, however I believe in the Windows 2000 Server platform,
it's only available in the enterprise edition. If you're already running two
systems that support this functionality, you may be able to achieve what you
want without having to change your client and without the expense of
additional hardware.

Cletus


Nicholas Paldino said:
Vai2000,

Personally, I think that this is something that should be handled in
hardware. Basically, you would set up a web farm, and the hardware
servicing the request would be responsible for determining which machine
would service it, based on availability (in which case an outage would mean
there is none for that one machine).

However, if you must do this in software on the call side, I would just
wrap the call in a try/catch block, and if an exception occurs (which
indicates the machine is down), I would make the call again, making sure
that the service that the proxy is pointing to is the one on the backup
machine.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Vai2000 said:
Hi All, I have a box outside the DMZ that calls my WebSvc 's. I have 2
boxes
running the WebSvc's though one is like backup (so both don't run
concurrent).
Incase of outage when the first box is not responding I want to call the
WebSvc from the Box No.2
How do I accomplish that..?

Q. How can I detect that my WS on Box1 is down?
Q how can I call WS from Box2?

For now...I have made the property of WS to be dynamic and the WSDL is in
the Web.config of the Caller.


TIA
 
Back
Top