开发者

Can a channel with WebHttpBehavior be in a faulted state?

开发者 https://www.devze.com 2023-03-10 14:14 出处:网络
I\'m using WCF to communicate to a 3rd party REST/JSON servic开发者_如何学运维e.Since it\'s WCF, I create a channel and send requests through it using WebHttpBinding and WebHttpBehavior.I am the clien

I'm using WCF to communicate to a 3rd party REST/JSON servic开发者_如何学运维e. Since it's WCF, I create a channel and send requests through it using WebHttpBinding and WebHttpBehavior. I am the client consuming the service. Is it possible for my channel to be stuck in a faulted state (where I would have to call Abort and recreate it to continue using it)? I have tried using it to make calls that return 404 errors or 500 errors and subsequent requests on the same instance of the channel still succeed.

It makes sense to me that it wouldn't fault, because this type of service is very disconnected compared to other services.


WebHttpBinding doesn't use sessionful channel so error on the service will not fault the channel but you should still correctly handle closing and aborting channel in case of communication exceptions etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号