AnsweredAssumed Answered

Need a help to read XML using groovy script.

Question asked by vaibhav.khairnar1128594 on Oct 13, 2016
Latest reply on Dec 1, 2016 by Adam Arrowsmith

Hi,

I'm trying to read the xml input mentioned in below format using groovy script but not able to generate the expected output mentioned as below :

 

Input :

<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<AssetDetailsRequest>
<AssetName>cmfloukp001a</AssetName>
<UserSSO>502191858</UserSSO>
</AssetDetailsRequest>
</soapenv:Body>
</soapenv:Envelope>

 

Output : Expected format

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:get="http://www.service-now.com/GetAssetDetails">
<soapenv:Header/>
<soapenv:Body>
<get:execute>
<get:AssetName>cmfloukp001a</get:AssetName>
<get:UserSSO>502191858</get:UserSSO>
</get:execute>
</soapenv:Body>
</soapenv:Envelope>
</xsl:template>
</xsl:stylesheet>

 

Can someone please help me out on this one.

 

Thanks !!

Outcomes