Monday, August 23, 2004 09:52 AM
Since SOAP faults are handled at the web service provider level, you will not be able to explictly send a SOAP fault to the client from whithin your application level. SOAP faults are meant to convey the details of the failure in the SOAP layer to the client and not for application layer errors.
The best thing to do, would be to define your own failure or error object containing details of the failure and send it back as part of your response.
If you were using Axis...(it may be possible on WebSphere too, I am not sure):
One indirect way of achieving this is to introduce a requestHandler in your requestFlow and customize the handler to pre-process the incoming XML (SOAPBody) and throw an AxisFault exception from the handler's invoke() method if your failure condition is matched (if aString value equals "samplestring").
This will return to the client in the form of a SOAP fault.