Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.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

like image 302
Yon Avatar asked Nov 05 '22 13:11

Yon


1 Answers

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.

like image 88
Louis S. Berman Avatar answered Nov 15 '22 06:11

Louis S. Berman