cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP message : Namespace replacement and tag names to be replaced

former_member191435
Contributor
0 Kudos

Hi All,

I have target structure to be created as below:

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

- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:Q-ENV="http://www.quadrem.com/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

- <SOAP-ENV:Header>

- <Q-ENV:Header>

<Q-ENV:Sender-Id>Sender TPID or TPUniqueID here</Q-ENV:Sender-Id>

<Q-ENV:Receiver-Id>Receiver TPID or TPUniqueID here</Q-ENV:Receiver-Id>

<Q-ENV:Correlation-Id>xyzc78c-7b54-1000-b7c3-0a0e06a80001</Q-ENV:Correlation-Id>

<Q-ENV:Message-Id>fb6b56fd-6c91-4b4f-b4a4-a5d7995f2281</Q-ENV:Message-Id>

<Q-ENV:Date-Sent>20120628T12:26:16GMT</Q-ENV:Date-Sent>

<Q-ENV:Document-Type>ServiceEntrySheet</Q-ENV:Document-Type>

<Q-ENV:Message-Format>Quadrem 1.0</Q-ENV:Message-Format>

</Q-ENV:Header>

</SOAP-ENV:Header>

+ <SOAP-ENV:Body>

+ <Q-ENV:Body>

<Q-ENV:Content-Type>text/xml</Q-ENV:Content-Type>

<Q-ENV:Message-Type>xCBL</Q-ENV:Message-Type>

<Q-ENV:Encoding>UTF-8</Q-ENV:Encoding>

- <Q-ENV:Message-Body>

<?soxtype urn:x-commerceone:document:com:commerceone:XCBL30:XCBL30.sox$1.0?>

- <!--

 xCBL 3.0 Document goes here.  If not using xCBL 3.0, then whatever XML type using goes here, but will require custom code 

-->

</Q-ENV:Message-Body>

</Q-ENV:Body>

+ < </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

But the output structure i am able to get is as below:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1><ns2:QSOAP_Final xmlns:ns2="urn:AGA.co.za:Quadrem:PurchaseOrderOutbound:SAR">

<HEADER>

<Header>

<ns1:Header xmlns:ns1="http://www.quadrem.com/soap/">

         <ns1:Sender-Id/>

         <ns1:Receiver-Id/>

         <ns1:Correlation-Id/>

         <ns1:Message-Id/>

         <ns1:Date-Sent/>

         <ns1:Document-Type/>

         <ns1:Message-Format/>

      </ns1:Header></Header></HEADER><BODY><Body><ns1:Body xmlns:ns1="http://www.quadrem.com/soap/">

         <ns1:Content-Type/>

         <ns1:Message-Type/>

         <ns1:Encoding/>

         <ns1:Message-Body/>

      </ns1:Body></Body></BODY></ns2:QSOAP_Final></ns0:Message1></ns0:Messages>

Can anybody please suggest what to do to get the above mentioned target format for namespace and even element tag names

Regards,

Rohini Potham

Accepted Solutions (0)

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi seenu,

I think you could use a XSL mapping to do this conversion. This mapping, obviously should be the last one in the operation mapping.

I write here an example where retrieve only one tag, the rest will be similar:

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

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:Q-ENV="http://www.quadrem.com/soap/" version="1.0">

    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">

        <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

            <ns0:Message1>

                <ns2:QSOAP_Final xmlns:ns2="urn:AGA.co.za:Quadrem:PurchaseOrderOutbound:SAR">

                    <HEADER>

                        <Header>

                            <ns1:Header xmlns:ns1="http://www.quadrem.com/soap/">

                                <ns1:Sender-Id>

                                    <xsl:value-of select="SOAP-ENV:Envelope/SOAP-ENV:Header/Q-ENV:Header/Q-ENV:Sender-Id"/>

                                </ns1:Sender-Id>

                                <ns1:Receiver-Id/>

                                <ns1:Correlation-Id/>

                                <ns1:Message-Id/>

                                <ns1:Date-Sent/>

                                <ns1:Document-Type/>

                                <ns1:Message-Format/>

                            </ns1:Header>

                        </Header>

                    </HEADER>

                    <BODY>

                        <Body>

                            <ns1:Body xmlns:ns1="http://www.quadrem.com/soap/">

                                <ns1:Content-Type/>

                                <ns1:Message-Type/>

                                <ns1:Encoding/>

                                <ns1:Message-Body/>

                                <ns1:Message-Body/>

                            </ns1:Body>

                        </Body>

                    </BODY>

                </ns2:QSOAP_Final>

            </ns0:Message1>

        </ns0:Messages>

    </xsl:template>

</xsl:stylesheet>

Regards.

Message was edited by: Iñaki Vila

former_member191435
Contributor
0 Kudos

hi Inaki,

I do not know how to write xslt mapping.

can you please guide me in doing the same.

Regards,

Rohini

iaki_vila
Active Contributor
0 Kudos

Hi,

At first you need an external tool to work with XSL mappings locally. I recommend you the free tool editix (Under windows (http://www.freexmleditorsite.com/download/editix-free-2008-sp2-win.exe)


With this tool you create the XML that you want to transform and the XSL to make the transformation:

I only have done the first tag mapping:

<ns1:Sender-Id>

<xsl:value-of select="SOAP-ENV:Envelope/SOAP-ENV:Header/Q-ENV:Header/Q-ENV:Sender-Id"/>

</ns1:Sender-Id>

You should write all tags like this in the XSÑ, but with the correct path in the source XML.

When you finish thaht mapping you need to zip the file in order to upload to ESR:

And you assign this XSL to your corresponding opertation mapping:

Regards.