Reputation: 6317
I'm trying to write an extension that will allow me, for each and every WCF operation I run, if it returns with a timeout error, to start a new proxy and try again (once).
I know that Michelle Leroux Bustamante wrote a code-gen'ed proxy that does the same, but I'm trying to do this without having to modify or replace the service client (I am handed down the proxy from the service provider).
Is this possible? From looking at IClientMessageIntercepter , which I believe to be the extension point I need, I couldn't figure out how to anything except modifying the message, or commenting (i.e logging) about the message.
Please help, Thanks - Assaf.
Upvotes: 0
Views: 281
Reputation: 27374
There's no extension point for that.
However, Castle WCF Facility is a layer of smarts on top of WCF and can do that for you.
The documentation on the website is outdated, but look at the unit tests, or ask on the users group if you have any questions.
Upvotes: 1
Reputation: 13849
I don't think you can really use an extension point for that, since they all run as part of the "execution pipeline" of the request itself, instead of outside of it.
Really, your best bet is a modified proxy, and while I understand you're getting a proxy handed down from your provider, there's no reason you couldn't retain all the data contracts and message definitions and implement your own custom ClientBase<T>-derived class to act as the actual proxy (which you could base off the code generated by Michelle's tool).
If that's not an option, either, then I guess you'll be pretty much stuck with doing it the old fashion way: Wrapping the proxy given by your provider in your own class that handles your retries.
Upvotes: 1