C# WCF/WebService: Interoperable exception handling.

Posted by michael paul on Stack Overflow See other posts from Stack Overflow or by michael paul
Published on 2011-01-10T19:34:26Z Indexed on 2011/01/10 21:53 UTC
Read the original article Hit count: 447

I understand that WCF will convert an exception into a fault and send it back as a SOAP message, but I was wondering if this is truly interoperable. I guess I'm having a tough time trying to figure out this possible scenario:

  1. Client (Java) calls a WCF Service (LoginService).
  2. Server checks for proper authorization, user authorization fails.
  3. Server throws an UnauthorizedAccessException.
  4. WCF converts this into a Fault somehow. (* - See Below As Well)
  5. Client has to be able to know how to read this Fault.

I guess I'm just having a tough time understanding how this could still be interoperable because it is expecting Java to know how to translate a SOAP Fault that .NET encodes from an UnauthorizedAccessException.

  • Also, how does .NET actually convert the exception to a fault, what goes in as the fault code, name, etc. Some of the things seem to be "duh"s like perhaps the Fault Name is "UnauthorizedAccessException", but I'd rather know for sure than guess.

© Stack Overflow or respective owner

Related posts about wcf

Related posts about exception