on 01-18-2016 1:05 PM
Hi Experts,
I am working on Webservice to Webservice SYNC scenario,
My query is i am able to get the response but the response format doesn't match the format required in PI mapping.
Response format from third party is as follow:
<ns1:getFoodNameResponse xmlns:ns1='http://http.service.test.com' soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><getFoodNameReturn xsi:type='xsd:string'>Your food name is :IDLI</getFoodNameReturn></ns1:getFoodNameResponse>
whereas we require below format in PI:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:getFoodNameResponse xmlns:ns0="http://http.service.test.com">
<ns0:getFoodNameReturn>IDLI</ns0:getFoodNameReturn>
</ns0:getFoodNameResponse>
Can anyone provide XSLT or Java mapping for the same?
It's urgent..Please help
Hello Ashsih,
If your using WSDL from webservice,Why don't you try mapping with Graphical mapping instead of XSLT mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu,
Request mapping is working fine. But when we recieve a response from third party it comes in below format.
<ns1:getFoodNameResponse xmlns:ns1='http://http.service.test.com' soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><getFoodNameReturn xsi:type='xsd:string'>Your food name is : Grapes</getFoodNameReturn></ns1:getFoodNameResponse>
This gives error in the response mapping as it is not in the expected xml format.
It creates empty xml like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT1 xmlns:ns1="http://Sample.com/dummy_test"></ns1:MT1>
whereas the expected response should be in below format:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:getFoodNameResponse xmlns:ns0="http://http.service.test.com">
<ns0:getFoodNameReturn>Mango</ns0:getFoodNameReturn>
</ns0:getFoodNameResponse>
So i need a xslt mapping or UDF code so that i can convert the response coming from third party to the required format.
Hi Ashish,
You can use below XSLT mapping.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ns0:getFoodNameResponse xmlns:ns0="http://http.service.test.com">
<ns0:getFoodNameReturn>
<xsl:value-of select="/ns0:getFoodNameResponse/getFoodNameReturn"/>
</ns0:getFoodNameReturn>
</ns0:getFoodNameResponse>
</xsl:template>
</xsl:stylesheet>
Regards,
Praveen.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.