Skip to Content

Proxy to SOAP Sync. Scenario - Fault Handling Issue

Mar 16 at 07:13 PM


avatar image
Former Member

Hi Experts,

I am facing an issue in capturing the fault from the Webservice and sending it back to the ECC system, in a Proxy to SOAP synchronous scenario.

I have gone through blogs with similar issues and have tried the steps as directed but still unable to reach a solution.

1. I have checked the "Do Not Use SOAP Envelope" in the SOAP Receiver Channel

2. I have used the following module configuration.

3. I have also used a Fault Message Mapping with the Error Message in the WSDL provided by the third party.

4. The fault message looks like below:

When the SOAP request is missing the country code, the Webservice returns the above fault response but it is not sent back to the ECC system. Instead it is visible in the PI message monitor as a Log Version and the outbound message has the status "Cancelled"

5. In the aforesaid scenario, the error shown in the "Cancelled" message points to the Response Mapping and not the Fault Mapping.

Transmitting the message using connection AFW failed, due to: Error encountered while executing mapping: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_Res_; Details:; The markup in the document following the root element must be well-formed.

6.The happy path is working perfectly and we are using XSLT mapping for removing the SOAP envelope from the response before feeding it to the Response Mapping.

Requesting your valuable help in resolving this issue.

error-response.jpg (53.4 kB)
mm-error.jpg (53.2 kB)
mm-error.jpg (37.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Evgeniy Kolmakov Mar 17 at 11:04 AM

Hi Krishna!

The point is that in case of System Fault you should use response mapping, not the Fault mapping. Fault mapping is intended to be used to catch Application faults.

You should check your response message in mapping: if element "soapenv:Fault" exists - you've got System fault response, otherwise - it's normal response.

Regards, Evgeniy.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thanks Evgeniy.

Following your lead, I created a Combined Envelope XSD and used it as the Response Message Type

The source of this looks as follows:

However, the Fault Response sent by the Webservice (mentioned in my original question), does not have any namespace prefix for the nodes faultcode, faultstring and detail. Hence when i copy paste that xml into the above source text box, the subnodes of the Fault are shown in RED and hence, the mapping is not successful. Can you kindly suggest a solution to this ?

combinedwsdl.jpg (38.2 kB)
responsesource.jpg (47.0 kB)

Hi Krishna!

I would strongly suggest using XSL transformation for response mapping. When using it you don't need to define the complex response message structure in ESR (you may use standard response structure) since no schema validation is performed when you use XSL transformation.

Regards, Evgeniy.

Former Member

Thanks Evegeniy,

The XSL transformation idea actually worked.

What we did was to add an XSLT mapping before the original response mapping to add the <soapenv: prefix to the three nodes faultcode, faultstring and detail.

Both the fault and successful responses are working perfectly now. Thanks a lot for your suggestions :)