Skip to Content

SOAP envelope/header and body addition using XSLT Mapping in SAP PI

code.txtDear All,

I have a requirement to add the SOAP Envelope, Header and Body segments to match the desired format required by the target party. I have tried to use XSLT to achieve this. I tried with the below code but when I test in the operation mapping using 1 to 2 (1- Message mapping, 2-xslt), it fails with below error in PI Operation mapping test :

Transformer Configuration Exception occurred when loading XSLT SOAP_ENV.xsl; details: Could not compile stylesheet

Can anyone please let me now what could be the root cause and what should be the correct XSLT code to be used if mine below is not correct (if something else to be modified in this code to handle in PI mapping)?

CODE :

http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem=" http://tempuri.org/">

<soap:Header />

<soap:Body> <xsl:copy-of select="."/>

</soap:Body>

</soap:Envelope>

</xsl:template>

</xsl:stylesheet>

PS: I tried in Stylus Studio, there it is giving me the desired output but during testing in PI Operation Mapping, getting the below error. Please help.

Transformer Configuration Exception occurred when loading XSLT SOAP_ENV.xsl; details: Could not compile stylesheet

code.txt (383 B)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Sep 10, 2017 at 07:59 AM

    Hi Amita!

    Try to remove the space in Header tag.

    The second option is to change XSLT processor to Xalan in your Stylus project and run the test.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2017 at 06:17 PM

    Hi All,

    I am able to run in the Operation Mapping using the attached XSLT code. xsltcode.txt

    Now, I am getting the output as attached and below output-xslt.txt. But I need to replace the namespace prefix "ns0" with "tem" at all places in the output. Can you please let me know what can be done to modify the XSLT code to achieve this?

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

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

    <soap:Body>

    http://tempuri.org/">

    <ns0:declarantTin>abcd</ns0:declarantTin>

    </ns0:BillingRequest>

    </soap:Body>

    </soap:Envelope>

    xsltcode.txt (453 B) output-xslt.txt

    (336 B)

    Add comment
    10|10000 characters needed characters exceeded