cancel
Showing results for 
Search instead for 
Did you mean: 

Remove SOAP Envelop using XSLT mapping.

Former Member
0 Kudos

Hi,

I need a code to remove SOAP Envelop using XSLT mapping.

Source:

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

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

<soapenv:Body>

<getServerTimestampResponse>

<result>

<timestamp>2008-06-19T14:22:25.004Z</timestamp>

</result>

</getServerTimestampResponse>

</soapenv:Body>

</soapenv:Envelope>

target:

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

<a>

<b>

<c>2008-06-19T14:22:25.004Z<c>

</b>

</a>

Please help me in this

Thanks&Regards,

Yuga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Also try this to create the target file you mentioned:


<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="//result">
 <c>
    <xsl:value-of select="timestamp"/>   
 </c>           
</xsl:template>            
</xsl:stylesheet>

Liang

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

<?xml version='1.0' ?>

<xsl:stylesheet version="1.0" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

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

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

<xsl:template match="/">

<ns0:c>

<xsl:copy-of select="SOAP-ENV:Envelope/SOAP-ENV:Body"/ />

</ns0:c>

</xsl:template>

</xsl:stylesheet>

This will get your whole body...

Your root node should belong to some namesapce...i.e. getServerTimestampResponse .

Thanks,

Vijaya.

Former Member
0 Kudos

Hi Vijaya,

Your code works fine but I need only the value.

It shlould be like this..

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

<ns0:MATMAS05 xmlns:ns0="http://wipro.com/SFDCScenario/Queries">

<ns0:IDOC>

<ns0:EDI_DC40>

<ns0:MANDT>2008-06-19T14:58:48.600Z </ns0:MANDT>

</ns0:EDI_DC40>

</ns0:IDOC>

</ns0:MATMAS05>

Instead I'm getting the output like this:

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

<ns0:MATMAS05 xmlns:ns0="http://wipro.com/SFDCScenario/Queries">

<ns0:IDOC>

<ns0:EDI_DC40>

<ns0:MANDT>

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

<getServerTimestampResponse xmlns="urn:enterprise.soap.sforce.com">

<result>

<timestamp>2008-06-19T14:58:48.600Z</timestamp>

</result>

</getServerTimestampResponse>

</soapenv:Body>

</ns0:MANDT>

</ns0:EDI_DC40>

</ns0:IDOC>

</ns0:MATMAS05>

Former Member
0 Kudos

Hi Vijaya,

The problem get solved.

Instead of the copy-of i put it as value-of.

Thanks for your help,

Yuga

Former Member
0 Kudos

Hi,

Ya, thats' what i told. Just map the require field and it will work.

Cheers

Amit

Former Member
0 Kudos

Hi,

I am not sure what is your exact question. It is doable.

Just map the Filed you want to poulate and don't map any other field. You won't get the SOAP Envelope. Can you please explain me your full scenario?

Thanks

amit

former_member181962
Active Contributor
0 Kudos

Why do you want to remove it in mapping?

I think there is an option to remove the SOAP Envelope in the SOAP Adapter.

Regards,

Ravi