Yon
Yon

Reputation: 1033

.NET Webservice Client: Auto-retry upon call failure

We have a .NET client calling a Java webservice using SSL. Sometimes the call fails due to poor connectivity (the .NET Client is a UI that is used from the weirdest locations). We would like to implement an automatic retry mechanism that will automatically retry a failed call X times before giving up. This should be done solely with specific types of connectivity exceptions (and not for exceptions generated by the web service itself).

We tried to find how to do it on the Binding/Channel level, but failed... any ideas?

Thanks, yonadav

Upvotes: 5

Views: 2169

Answers (1)

Louis S. Berman
Louis S. Berman

Reputation: 994

Check out the Michelle Bustamante's Exception Handling Proxy Generator. It automatically handles retries:

http://wcfproxygenerator.codeplex.com/

From the site:

This custom tool extends WCFProxyGenerator to provide an exception handling proxy. It generates an additional proxy called ExceptionHandlingProxy which inherits ExceptionHandlingProxyBase - the latter of which implements the meat of the proxy's functionality. The result is that you can choose to use the default proxy that inherits ClientBase or ExceptionHandlingProxy which encapsulates managing the lifetime of the channel factory and channel. ExceptionHandlingProxy respects your selections in the Add Service Reference dialog with respect to asynchronous methods and collection types.

Upvotes: 2

Related Questions