cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with SOAP Message

former_member10771
Active Participant
0 Kudos

Hi All,

Can someone please provide me inputs on the below. The WSDL which I am getting from the external team is of this format.

<soapenv:Envelope >

<soapenv:Header>
      <v2:XHeader>
        Header Fields
      </v2:XHeader>
   </soapenv:Header>
   <soapenv:Body>
      Body Fields
   </soapenv:Body>
</soapenv:Envelope>

I have imported the same in PO. But its just not able to pass the message mapping step and its failing as it doesnt recognize the fields.

Most of the WSDL which I have worked have had this format as below where in inside the Body part we have both header and body data.

But the one above has a separate header node where in the header details are mentioned and a separate body node. Am I missing something. Will this type of WSDL work . What needs to be done for the same. Development is a later step but at present I am not even able to pass this via mapping step.

<soapenv:Envelope>

   <soapenv:Header/>

   <soapenv:Body>

               <Header>

            Header Fields

               </Header>

               <Body>

                 Body Fields

               </Body>

   </soapenv:Body>

</soapenv:Envelope>

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Amit,

I suppose you want to skpi the namespace v2  in the result.

Then with this source XML:


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

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="yournamespaceforv2">

    <soapenv:Header>

        <v2:XHeader>

         <tag1>h1</tag1>

         <tag2>h2</tag2>

      </v2:XHeader>

    </soapenv:Header>

    <soapenv:Body>

      <tag3>tb1</tag3>

      <tag4>t4</tag4>

   </soapenv:Body>

</soapenv:Envelope>

If you appy this XSL (you can notice the two last templates are used to ommit the namespace v2):


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="yournamespaceforv2" exclude-result-prefixes="v2">

    <xsl:output omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="/soapenv:Envelope">

        <soapenv:Envelope>

            <soapenv:Header/>

            <soapenv:Body>

                <Header>

                    <xsl:apply-templates select="soapenv:Header/v2:XHeader/node()"/>

                </Header>

                <Body>

                    <xsl:apply-templates select="./soapenv:Body/node()"/>

                </Body>

            </soapenv:Body>

        </soapenv:Envelope>

    </xsl:template>

    <xsl:template match="soapenv:Header/v2:XHeader/node()">

        <xsl:element name="{local-name()}">

            <xsl:apply-templates select="@* | node()"/>

        </xsl:element>

    </xsl:template>

    <xsl:template match="./soapenv:Body/node()">

        <xsl:element name="{local-name()}">

            <xsl:apply-templates select="@* | node()"/>

        </xsl:element>

    </xsl:template>

</xsl:stylesheet>

You will get this XML:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <soapenv:Header/>

    <soapenv:Body>

        <Header>

            <tag1>h1</tag1>

            <tag2>h2</tag2>

        </Header>

        <Body>

            <tag3>tb1</tag3>

            <tag4>t4</tag4>

        </Body>

    </soapenv:Body>

</soapenv:Envelope>

Hope this helps.

Regards.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

You have to use Java mapping or XSLT to parse this. Aside from that, the Do Not Use SOAP Envelope option should be checked in the sender or receiver adapter.

Regards,

Mark

former_member10771
Active Participant
0 Kudos

Hi Mark,


Can you please point me to some guide to remove the SOAP header using XSLT.

azharshaikh
Active Contributor
0 Kudos

Hi Amit,

Please check the following links if it helps:

Regards,

Azhar