cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP Fault - Catch Error Content

brecht_bauwens
Explorer
0 Kudos

Hi,

I'm encountering following issue:

From PI I'm calling a synchronous web service using SOAP adapter. This service does return SOAP Fault message, without the "detail" tag.

This results in system error which I can capture via ccBPM.

But is there a possibility to capture the content of that system error (SAP:Error) within a mapping in order to send error details to sender.

Example of system error message:

<SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. ---> There is an error in XML document (1, 409). ---> Input string was not in a correct format.</SAP:AdditionalText>

<SAP:Stack /> 
<SAP:Retry>M</SAP:Retry>

</SAP:Error>

I would like to extract the content of the "SAP:AdditionalText" info in order to fill response message.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member207622
Contributor
0 Kudos

Hi

I think you would require to do a fault response  mapping and map the content of field Additional text to the sender structure in order that the sender would be notified

I had a similar case this is sample xsl mapping which might be use to you , you will need to modify it .

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://xyz">

<xsl:param name="inputparam"/>

<xsl:template match="/">

<!-- change dynamic configuration

    <xsl:variable name="dynamic-conf" 

        select="map:get($inputparam, 'DynamicConfiguration')" />

    <xsl:variable name="dynamic-key"  

        select="key:create('SENDER_SERVICE')" />

    <xsl:variable name="dynamic-value"

        select="dyn:get($dynamic-conf, $dynamic-key)" /> -->

   

       <!-- Generate SAP Fault mesage payload -->

    <ns1:MT_Fault xmlns:ns1="http://xyz">

        <standard>

            <faultText>Error Returned from abc</faultText>

            <faultDetail>

             <text><xsl:value-of select="//message[1]"/></text>

             <id><xsl:text>abc</xsl:text></id>

             </faultDetail>

    </standard>

    </ns1:MT_Fault>

  

</xsl:template>

</xsl:stylesheet>