Skip to Content

Filter or Extract Data from SOAP Adapter

Hello,

I am currenly testing out SAP CPI. Now i am trying to build a simple process flow but i have a problem. I dont know how to extract an ID from a payload.

The payload ist from a SOAP receiver adapter. It is in XML Format, and the ID is in the Header How can I accomplish this effectively?

The structure of the XML is something like this.

Encoding: UTF-8 <?xml version='1.0' encoding='UTF-8'?>
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema">
<CostCenter xmlns="virCostCenter">
<UUID>some id is here</UUID></CostCenter>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<Connect_CostCenterResponse xmlns="virCostCenter">
</Connect_CostCenterResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Thank you very much.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Mar 20 at 02:25 PM

    Hi Nils-Aurel

    If your goal is to extract the contents of the UUID element, once the SOAP receiver channel returns a response, you can do so by adding a Content Modifier configured as follows:

    This puts the contents of the element into a property called uuid.

    Regards,

    Morten


    property.png (42.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 20 at 01:23 PM

    Hello Nils,

    Please refer the below blog having all the necessary information required for your query.And you need to write a groovy script for the same and refer code snippets from blog.

    https://blogs.sap.com/2019/04/08/cloud-integration-accessing-and-setting-soap-headers-in-an-integration-flow/

    Regards,

    Sriprasad Shivaram Bhat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 23 at 02:12 PM

    Hi Nils-Aurel

    The Content Modifier, I showed you, doesn't change the payload. It just stores the value in a so-called Exchange Property, which you can think of as an iflow variable.

    If you want to run an XSLT mapping immediately after the Request-Reply step, i.e. while the payload is still the SOAP response, you can just change your xsl:value-of to:

    <xsl:value-of xmlns:ns="CostCenter/wsKostenstelle" select="//ns:UUID"/>

    The UUID element belongs to the CostCenter/wsKostenstelle namespace, so that needs to be reflected in the xsl:value-of element.

    Regards,

    Morten

    Add a comment
    10|10000 characters needed characters exceeded

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.