views:

44

answers:

1

Perhaps I'm overlooking something, but can client WCF not handle a server response that isn't a 200? For example, I'm trying to consume a service that returns a 400 when you asked for something naughty, but the body of the response is still a perfectly good and consumable SOAP message. It does the same for requested data that doesn't exist, returning a 404 but still having good hints about what the problem is. The WCF proxy seems to just puke and I can't get at the underlying body of the message.

Is that really how it rolls?

+1  A: 

The only way to do this is to capture the protocol exception and then manually unserialize the envelope. The channel is hard coded to always throw a fault anytime an non 200 web response.

Aaron Weiker