Search code examples
wcfsilverlightdisposechannelstateful

Silverlight Dispose pattern with WCF (Async)


I'm a little new to Silverlight, and I want to know how to deal with the Faulted/Disposing of a WCF service.

I'm used to something like this (wcf abort/close pattern) where you call the service in a try/catch (making sure you close or abort). (which works well in a stateless application)

looking into Silverlight, where do we apply the abort/close pattern? as the service call is async and the application is state full.

At the moment the only thing I can think of is some sort of dynamic proxy (using something like Castle DP) accompanied with the ChannelFactoryManager from the n-tier app, about 1/2 way down the page example. where the proxy will ensure there is always an open channel and the ChannelFactoryManager will handle the faults


Solution

  • Solution using Castle DP with the ChannelFactoryManager implemented and detailed here:

    http://www.codeproject.com/Articles/502121/WCF-in-a-stateful-application-WPF-Silverlight