cancel
Showing results for 
Search instead for 
Did you mean: 

Process XML data embedded in the SOAP Envelope in PI

dichaudhuri
Explorer
0 Kudos

HI,

     I have a requirement where PI will be consuming the webservice of client system and the below structure will come back as a response. Now while generating an XML file for the error payload below, the data is getting garbled as a result a proper XML is not getting generated.

I understand I would be requiring a Java code to handle this which is fine. But my queries are as below :-

1.) Since it is a synchronous scenario, will the SOAP receiver process the below data or it will fail in the adapter SOAP receiver adapter itself?

2.) Will the data come inside PI and hit the Mapping Step and before that I can put a java mapping to remove the envelopes etc and send it to ECC ?

3.) Also there are French umlauts which are present in the payload will that show up in the message monitor as it is send from the target system?

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body>

<GenerateResponse xmlns="http://www.abc.fr/">

    <GenerateResult>

      <ErrorCode>0</ErrorCode>

      <Value>

          <ErrorLog>&lt;?xml version="1.0" ?-UTF-8&gt;

                                   &lt;File name="20150407_093849_158.XYZ" importDate="07/04/2015 09:38:49"&gt;

                                   &lt;Event Date="07/04/2015 09:38:49" Tag="IMPORT_EVENT_IMPORT_START"&gt;

                                   &lt;/Event&gt;

                                   &lt;Event Date="07/04/2015 09:38:49" Tag="SHIPMENT_CREATION_ERROR"&gt;

                                   &lt;Erreur&gt;Vos colis n'ont pas de numéro de pointage unique.&lt;/Erreur&gt;

                                   &lt;/Event&gt;

                                   &lt;/File&gt;

               </ErrorLog>

               <LabelList />

     </Value>

    </GenerateResult>

  </GenerateResponse>

</soap:Body>

</soap:Envelope>

Accepted Solutions (1)

Accepted Solutions (1)

former_member182412
Active Contributor
0 Kudos

Hi Diptendu,

>>>>1.) Since it is a synchronous scenario, will the SOAP receiver process the below data or it will fail in the adapter SOAP receiver adapter itself?

It will not fail in SOAP adapter

>>>>>2.) Will the data come inside PI and hit the Mapping Step and before that I can put a java mapping to remove the envelopes etc and send it to ECC ?

Yes the data will come to mapping without any problem because SOAP adapter will take the payload from body tag. you need to use XSLT mapping to handle this.

Regards,

Praveen.

dichaudhuri
Explorer
0 Kudos

cool then - let me try this! - will revert soon

Answers (2)

Answers (2)

RaghuVamseedhar
Active Contributor
0 Kudos

Diptendu,

Below blog has details on how to remove SOAP Envelope using XSLT.

How to create XSLT Mapping in SAP PI / PO

Use XSLT replace function to replace &gt; with <, &lt; with > and so on for &, ', ".

XPath, XQuery, and XSLT Function Reference

XML Syntax

Former Member
0 Kudos

Hi,

If that is the structure then that will be fine. If you are worried about the error log piece you dont have to be because it see that entire value as a string. Because it is within the <> tags.

Regards,

Jannus Botha

dichaudhuri
Explorer
0 Kudos

cool then - let me try this! - will revert soon