Need to throw a SOAP-FAULT

Hi All,

I am new to this group and Webservices.

I have a scenario where I need to return a SOAP-FAULT to the client in WM. I am using a default SOAP Processor. Currently the WM is returning the SOAP Response for the below condition but I need a SOAP-FAULT to be returned.

scenario:
1. Will check the connectivity with the database
2.If connectivity is not happening then return a SOAP-FAULT.

Format of SOAP-FAULT:

<SOAP-ENV:Envelope xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>
SOAP-ENV:Body
SOAP-ENV:Fault
SOAP-ENV:Server
[ISS.0088.9112] An Exception was thrown in the server
http://localhost:5555/soap/default

webM:exception
webM:classNamecom.wm.pkg.art.error.DetailedServiceException</webM:className>
<webM:message xml:lang="">[ART.117.4018] Adapter Runtime (Adapter Service): Error while closing transactions at service completion Error:[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections…
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.
[ART.117.4015] Adapter Runtime (Adapter Service): Error(s) occurred while closing adapter connections.</webM:message>
</webM:exception>

</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Please suggest how to do it.

thanks & Regards
Sree.

Just Exit with Failure from your Flow. The default soap-msg processor will generate a default soap fault with the message from your Exit statement.

It is also possible to customize the soap fault message and I have provided details on that in other threads in this forum.

Mark

Hi Mcarlson,

Thanks for your input, But the solution is not working. The reason may be that I am using 2 Flow services ( Wrapper Service & Main Service).

Wrapper Service working.
a)1 is wrapper service which will receive the SOAPrequestdata and convert it to a document and then call Main service where the actual processing takes place ( like selecting from DB and inserting into other DB). This above step takes place in a TRY block.

b) Once the Main service executes successfully and returns the SOAP-Response document and the flow will go to Finally block in Wrapper Service and the Response Document is converted to SOAP-ResponseData object and returned to client.

c) If the Main Service fails like I placed “Exit flow and Signal Failure in Catch block in Main Service” The flow will return to Wrapper service and go to Catch block and then Map the getLastError output to SOAP-Response document and the flow will go to Finally block in Wrapper Service and the Response Document is converted to SOAP-ResponseData object and returned to client.

So please suggest me your view on this.
I wanted to share my Code screenshot with you So provide me your personal ID to which I can send the code screenshot.

Thanks
Sree,

The wrapper Flow should call the service provider Flow in a try-catch block and simply re-throw any exception thrown by the provider Flow.

I am unable to conduct code reviews.

Mark

Hi Mcarlson,

I am not clear about your solution. Let me put my understanding here. From the Main Service we are “Exiting with Failure” message and in the Wrapper Service we are catching it again. YOu mean to say even in the Wrapper service after catching the Exception we need to “Exit with Signal Failure” again.

Please correct me if I am wrong.

And let me know how do we throw an Exception in WM which should look like a normal wM Server Exception.

Thanks Again for your Inputs.

regards
Sreenath.

Yes.

I don’t understand your question. Any exception thrown by a service invoked by a default IS SOAP processor will be converted into a SOAP fault.

Hi mcarlson,

Thanks for your Response.