Skip to Content

Fault Response Handling in Sync Interface

Hi Experts,

We are expecting a Fault response as mentioned below, in case of any failure.

Interface is SAP ECC--> SAP PI --> SOAP(Sync)



<Faultcode>Internal Server Error</Faultcode>

<Faultstring>Exception 8240986231</Faultstring>



We are using the standard FaultMessage Structure shown below and XSLT mapping to extract and send to ECC but it is not working and we are getting transformation error when testing in Operation Mapping.

Error:- Transformer exception occurred when executing XSLT FaultMessage (urn:ariba.XXX, -1, 597a66f0-78b0-11e6-) error logs for detailsTransformer exception occurred when executing XSLT FaultMessage

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:soapenv="">
<xsl:template match="//soapenv:Fault">
<xsl:value-of select="faultcode"/>
<xsl:value-of select="faultstring"/>

I tried with normal one to one graphical mapping as well - there I am getting error related to soapenv prefixes in the fault response.Please suggest.


Nidhi Srivastava

faultstructure.jpg (81.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Apr 09 at 01:56 PM

    The problem here is that the XML response from the web service server is not valid XML.
    I do not know if this is caused by the SAP PO adapter.
    Could you test the web service using SOAP UI?

    If the fault message is sent wrong from the server, there should be a fix on the server.

    The correct Fault message should have a SOAP envelope:">
    <faultstring>Server Error</faultstring>

    If this is missing, it won't work.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 07 at 01:31 PM

    The elements in your XSLT have different names as in your SOAP message. Element names are case sensitive.

    Have you tested your XSLT with a tool outside SAP PO?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 07 at 07:58 PM

    You can find many online tools, for example:

    I do not really understand: what is your input and your desired output?

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Stefan,

      The request is working fine, i have used addSoapEnvelope XSLT code to the structure as expected by the target.

      The problem is coming in response. Actually, I have followed the below mentioned blog as the faultcode is coming as a response(system error and not application error).

      As per the blog, I created the structure as mentioned in the screenshot below

      Problem is the response and fault response coming from the target is in different format and I am unable to deal with the XSLT code.

      In case of normal response - Envelope along with Header & Body is coming.Also, namespace prefix is coming as soap:

      In case of Fault response - Only Body and Fault tag is coming along with the namespace prefix as soapenv:

      The sample structure are attached for reference.


      I tried forming the XSLT using the link you provided, it was very helpful. But, as I am beginner to XSLT coding am unable to format the correct structure in which both the structures can be handled.

      Let me know if you have any suggestions.


      Nidhi Srivastava

      structure.txt (638 B)
      mesg.jpg (34.9 kB)
  • Posted on Apr 08 at 09:53 PM

    Hello Nidhi Srivastava,

    I tried both your "structure.txt" XMLs in an offline tool and came up with this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="" 
        exclude-result-prefixes="soap xsd xsi soapenv"
        <xsl:template match="text()"/>
        <xsl:template match="/soap:Envelope/soap:Header/*[namespace-uri()='XXX' and local-name()='Headers']/*[namespace-uri()='XXX' and local-name()='partition']">
                <xsl:value-of select="."/>
        <xsl:template match="soapenv:Body/soapenv:Fault/Faultcode">
                <xsl:value-of select="."/>            

    If I apply this to your 2 different XMLs I get this:

    success message

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

    error message

    <?xml version="1.0" encoding="UTF-8"?>
    <errorResponse>Internal Server Error</errorResponse>

    Try it in Stefan Grube's page, it is working.

    I hope that helps,

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Nidhi Srivastava,

      When I tested that XML I added this

      <soapenv:Body xmlns:soapenv="">
              <Faultcode>Internal Server Error</Faultcode>
              <Faultstring>Error Description</Faultstring>

      otherwise that XML will always show that error.

      Could you provide the XSD for that ErrorMessages structure? Just click on tab "XSD" in your first screenshot. THanks, Peter

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.