Hi Mattias!
Comments inline:
> The problem:
> ------------
>
> Our application needs to be able to return application errors
> in a way that makes it possible for a client to
> programmatically identify the error. The client should be
> able to take proper action and inform a user on various error
> events. Errors can include diverse things such as problems
> with a database and erroneous arguments (e.g. validation
> errors) and more. We would like to provide a mapping for each
> unique error condition and return this error in an encoded
> format possible for a client to interpret and translate to
> specific exception handling routines for the client platform.
Check.
> Possible solutions:
> -------------------
>
> 1. Encode the application error using the faultcode. I am a
> little uncertain if this is allowed according to the
> specification. An example of encoded error information could
> be "SOAP-ENV:Server.Application.DatabaseError",
> "SOAP-ENV:Server.Application.ValidationError" or something
> similar (am I allowed to "extend" the SOAP-ENV:Server with
> point notation?!). More specific information needed to
> describe an error could be embedded in the faultdetails
> (faultdetails in this case are not used to identify the type
> of error but to get more detailed information like stack
> traces for bug reports and similar).
This is absolutely the way to go. Faultcodes according to the SOAP spec are
explicitly extensible (http://www.w3.org/TR/SOAP/#_Toc478383510) just for
this purpose. Faultdetails would then be used just as you describe for more
detailed fault-specific info.
--Glen