Best Practices To Recover a Faulted Channel in spring.net
in spring.net you can easily use wcf channels:
<wcf:channelFactory id="Service" channelType="IDebtorService, Service" endpointConfigurationName="WcfDebtorEndpoint" />
<endpoint name="WcfDebtorEndpoint" address="http://localhost/ServiceHost/Debtor.svc" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding1" contract="IDebtorService" />
You can inject them in to other objects and use them there as normal objects. But how can I deal with faulted wcf channels in spring.net? Isn't it开发者_开发知识库 possible that spring wcf channels go into a faulted state?
How can I open, close, reopen or recreate a channel in spring.net?
If your channel is in fault state, you may understand the origin of your exceptions.
Using WCF, faulted channels are a state caused by unhandled exceptions. The correct handling about WCF exceptions (for servers) is using Faults. Faults can be handled by client and servers, without broken your channel.
Using Spring.Net in server-side, you may resolve that using AOP, Spring.Net AOP can help you to do this. To use AOP in WCF Services you don't need change anything. It's very simple because WCF require a Interface Based Contract for your service, it's helpful and required too by AOP engine.
Maybe you need an example: You may understand what i'm trying speak looking about my exception handling with WCF, Spring.Net and AOP. The class ExceptionHandlerAroundAdvice can clarify questions about this concept.
精彩评论