I would like to know whether it is good idea to raise a SOAP fault for Application or system level exceptions. For example, I'm searching for a user with an ID as request , If the ID is invalid(User is not found) is it OK to raise the SOAP Fault. Let me know your views regarding the same.
Originally posted by satish jupalli: I would like to know whether it is good idea to raise a SOAP fault for Application or system level exceptions.
Ideally you would declare your application level faults as SOAP faults in the WSDL. Your WSDL-to-Java code generator should then generate the necessary application exception classes when it generates the service skeleton.
Note however that it is totally up to the client (and its web service framework) to map the resulting SOAP faults to any equivalent exceptions - so the Java exception that you throw will not necessarily be the same that the client sees - it just gets the resulting SOAP fault.