Error handling in SOAP Web Services – The Right Way

I have seen too many web services (and done a few) where fault handing is not user friendly / graceful.  Most of the times the way people code the web services using annotations or using POJOs in  frameworks like Axis2 the SOAP faults just contains an error message since this is the easiest thing to do. However for  clients this is not too friendly as they can only do error handling  based on your error strings. SOAP 1.2 specifications here , provide a better way of populating your SOAP faults. That is to provide at-least SOAP codes, sub-codes and a fault string as well as details (if possible). This is old news, but i still thought should be talked about.  Continue reading