cancel
Showing results for 
Search instead for 
Did you mean: 

How to create soap envelope structure

Former Member
0 Kudos

Hello Friends,

I am working on a RFC to webservice sync scenario.Here I am getting response from webservice in soap envelope form which is not matching with my wsdl response structure. I have tried to create the envelope structure manually but i dint get success. Can any body guide me how to over come with it.

(I have already checked 'Do not create soap envelop' in receiver soap addapter).

Regards,

jayesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Do you need to pass a request message in a SOAP envelope? If not, you may uncheck the "Do Not Use SOAP Envelope".

on the receiver adapter so the response message will not be enclosed in a SOAP envelope.

But if SOAP envelope is necessary on the request, you would need a Java Mapping, parse the response message of the Webservice and get the Body without modifying or message structure.

Regards,

Jenny

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have done the same scenario using XSLT mapping. If you want to remove the soap envelope from the incoming message you could extract the required field value and put it in the required target structure

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

- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="the namespace of your target structure" xmlns:ns0="the namespace of the webservice" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

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

- <xsl:template match="/">

- <ns1:message type of your target structure>

- <Required fieldname>

<xsl:value-of select="soap:Envelope/soap:Body/ns0:the node name inside the body structure"/>

</Required fieldname>

</ns1:message type of your target structure*>

</xsl:template>

</xsl:stylesheet>

Former Member
0 Kudos

Problem Solved.

I have created xsd and imported in external defination. Instead of wsdl response structure I used this xsd to read response from webservice. Thanks to all.

Regards,

jayesh.

Former Member
0 Kudos

Hi Jayesh,

Can you tell me how did it got resolved by creating XSD? am facing similar issue now....how the <soapenv:Envelope & body tags are removed in the response message.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Jayesh,

you need java/ ABAP /XSLT mapping to convert to necessary structure.

Few queries

1. what is the version of PI you are working ?

2. Could you please kindly post the complete source and target XML structure.

regards

Anupam

Former Member
0 Kudos

Thanks Anupam and Jenny for your kind response.

I am wrking on PI 7.0. I dnt want soap envelope in payload so I have already checked the 'Do not create response' button still in response message I am getting the soap envelope.

I can use java or xslt but the the structure is not able to read the soap envelope. To read it I need to create same data structure which matches with the soap envelope.

this is the response I am getting through webservice.

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

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<createResponse>

<result>

<errors>

<message>Config Master Record Type Name value is missing</message>

<statusCode>FIELD_CUSTOM_VALIDATION_EXCEPTION</statusCode>

</errors>

<id xsi:nil="true" />

<success>false</success>

</result>

</createResponse>

</soapenv:Body>

</soapenv:Envelope>

And this is the wsdl structure

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

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

<ns0:result>

<ns0:errors>

<ns0:fields/>

<ns0:message/>

<ns0:statusCode/>

</ns0:errors>

<ns0:id/>

<ns0:success/>

</ns0:result>

</ns0:createResponse>

Because of the soap envelope it is not able to read it. I have to create new structure.

Experts please help me to solve this problem.

Regards,

Jayesh.

Former Member
0 Kudos

Hi Jayesh,

Kindly uncheck the Do Not Use SOAP envelope in the receiver comm. channel, then perform a test. If the SOAP envelope still exists on the response. Create a Java Mapping for your response message, use DOM/SAX parsing to get the structure inside the SOAP Body. Also on your java mapping, create the root node (createResponse with names space urn:enterprise.soap.sforce.com) then attach the structure from the SOAP Body on that node.

Regards,

Jenny

Former Member
0 Kudos

Hi Jenny,

I have done java mapping through which i am sending request payload to webservice in soap envelop form so I have checked 'Do not create soap envelope'.In response the webservice sending the response payload in soap envelope.But the datatype is not matching with the soap envelope. This data type is a message in wsdl.

To transform the payload to furhter mapping program first the source datatype should to read the payload which is not happning in my scenario.

Jayesh.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I have done java mapping through which i am sending request payload to webservice in soap envelop form so I have checked 'Do not create soap envelope'.In response the webservice sending the response payload in soap envelope.But the datatype is not matching with the soap envelope.

Use Java Mapping to construct the SOAP Envelope when there is a need to add customized SOAP header or when using SOAP 1.2; Otherwise, just develop your scenario as is and let the SOAP Receiver Adapter take care of adding/removing of the SOAP 1.1 Envelope.

Hope this helps,

Mark

Former Member
0 Kudos

Hi Jayash,

If you click on the option 'Do not include SOAP envelope' at SOAP receiver side means that, while sending XI message/payload to the target url (WS url), PI SOAP adapter removes the header information(i.e, SOAP Header tag) from the XI message and only payload (i.e,SOAP Body tag) is sent without having SOAP envelope tag. So in your requirement having this option would not help you.

Whaterver response you are getting from WS ( wth SOAP envelope), first it should be in SOAP message format (SOAP envelope, header and body), otherwise SOAP adapter would not accept the response message and throw exception.

So i suggest, to get only body information out of SOAP envelope, write a small adapter module and provide it in SOAP receiver channel and extract whaterver info you want and process further accordinly. Let me know if you need any help in writing adapter module.

Thanks,

RK

Former Member
0 Kudos

Hi Rajendra,

Thanks for you reply.

yes please guide me in writing the adapter module. but I have one doubt wether it will affet to request message also. I have done java mapping which is creating soap envelope in request mapping.And want to eliminate soap envelope from response.

Regards,

jayesh.