cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle soap faults from receiver webservice

Former Member
0 Kudos

The scenario is file to webservice. The file contains a record that I need to submit to the webservice. The issue I am having is rather than providing any error as a response message (or an error segment in the response) it returns a soap:fault for any issue, structural or data; or the response structure as defined in the WSDL on success.

I tried to use the Fault on the Synchronous service interface:

Created a XSD based on the soap:fault structure, linked the External Message to the Fault in the Service Interface.

Example of a fault:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

   <soap:Body>

      <soap:Fault>

         <faultcode>soap:UQ_TAG_NET_ID_DEL</faultcode>

         <faultstring>The specified Tag ID is already in use. Please specify a unique value.</faultstring>

         <detail>

            <FaultInfo>

               UQ_TAG_NET_ID_DEL

               <FaultParams>DataIntegrityViolationException</FaultParams>

            </FaultInfo>

         </detail>

      </soap:Fault>

   </soap:Body>

</soap:Envelope>

When a fault is encountered, only the following shows in message monitoring:

            <FaultInfo>

               UQ_TAG_NET_ID_DEL

               <FaultParams>DataIntegrityViolationException</FaultParams>

            </FaultInfo>

I would like to be able to route the response message to a file so that it can be reviewed by support team, rather than cause error in Runtime Workbench. Going forward it is likely that I will add routing based on the <faultcode>. Certain faults can be handled, possibly by calling another webservice to obtain more data then include in transform.

Thank you for your assistance.

Accepted Solutions (0)

Answers (3)

Answers (3)

iaki_vila
Active Contributor
0 Kudos

HI Tadd,

From my point of view Raghu suggestion is the best way to do it. However, you have more options like to generate the file in the response, in the mapping level, writing a file, you would need to it in an UDF or java mapping, like this example File Lookup in UDF - Process Integration - SCN Wiki

(notice this example is to read not to write).

Regards.

Former Member
0 Kudos

Hi Tadd,

  You may want to use the RequestResponseBean and ResponseOneWayBean in your sender file channel to capture the response from the web service and save that as a file on a file server.

Regards

Charan

RaghuVamseedhar
Active Contributor
0 Kudos

Tadd,

Please try Async-Sync bridge. Response mapping should be flexible to handle success and fault message. For initial testing, let the response be pass-through. After successful testing, develop mapping logic.

Link1, Link2.

Former Member
0 Kudos

Raghu, thanks for taking some time to provide feedback. I am still unsure if the Async-Sync bridge without BPM is the right solution for me. I made a high-level process flow of my scenario. I am OK with using BPM (we do have many running well) and feel if I can handle the soap:fault in a BPM decision flow then I could achieve my entire process. What approach do you think makes sense?

RaghuVamseedhar
Active Contributor
0 Kudos

Tadd,

Sync-Async bridge fits this requirement.

Target web-service (SOAP over HTTP), is synchronous. When a message is sent to target web-service, it will send back a success message or fault message. Use SOAPUI, to test target web-service.

Lets try this, SOAP <-> PI <-> SOAP. There will be request mapping and response mapping. Please configure this scenario and test it with SOAPUI. Sender agreement will have the WSDL details. Send a Tag ID which is already in use. You can will see response (fault message) in SOAPUI.

File can't be used for sync. So use Async-Sync bridge. Now configure a new scenario, File -> PI -> SOAP -> PI -> File. In response, use response mapping developed above.