cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI RFC to SOAP ...Problem in Requset message mapping

Former Member
0 Kudos

Hi ,

i am creating RFC to SOAP scenario .

Desired wsdl Request

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

<soap:Envelope 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">

<soap:Body>

<isLoginIdExistin0 xmlns="http://netpricing">xyz</isLoginIdExistin0>

<isLoginIdExistin1 xmlns="http://netpricing">1</isLoginIdExistin1>

</soap:Body>

</soap:Envelope>

Actual wsdl Request ( Payload )

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

what have to do so that i can get request in the format mentioned above.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Swapnil,

First, I am thinking how you are getting this root node, is it in WSDL?

You can also edit WSDL for the same and import again if it is acceptable to the web service appilcation.

About XSLT mapping:

You can remove root tag in XSLT mapping, use one XSLT mapping between RFC request strucutre and SOAP Req structure.

And map it according to your requirements.

Like:

<isLoginIdExistin0><xsl:value-of select="<your RFC field>"/></isLoginIdExistin0>

And dont add your root tag in XSLT mapping, so root tag will not be generated.

---Divyesh

Former Member
0 Kudos

Hi Divyesh,

Can you please tell me the xslt mapping for following code.

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

i think this will solve my problem.

former_member854360
Active Contributor
0 Kudos
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:template match="ns1:isLoginIdExistRequest"> 
    <xsl:apply-templates select="isLoginIdExistin0"/>  
     </xsl:template>  
 <xsl:template match="*">   
 <xsl:copy>
<xsl:apply-templates/>
</xsl:copy>   
</xsl:template> 
</xsl:stylesheet>
former_member854360
Active Contributor
0 Kudos

Use this code

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <xsl:template match="/">   
        <xsl:copy-of select="./*[1]/*[1]" />    
<xsl:copy-of select="./*[1]/*[2]" />  

  </xsl:template>  </xsl:stylesheet>

Former Member
0 Kudos

Hi Debashish,

Our scenario is RFC to SOAP

when we are applying your XSLT mapping it is get applied in sender side that is RFC side

but we want that on the receiver side .

means the request received at receiver end is without header node.

Thanks,

Swapnil

former_member854360
Active Contributor
0 Kudos

Hi your input to the XSLT should be

INPUT

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

OUTPUT

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

<soap:Envelope 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">

<soap:Body>

<isLoginIdExistin0 xmlns="http://netpricing">xyz</isLoginIdExistin0>

<isLoginIdExistin1 xmlns="http://netpricing">1</isLoginIdExistin1>

</soap:Body>

</soap:Envelope>

Former Member
0 Kudos

Hi Debashish,

Our scenario is RFC to SOAP ( Synchronous ).

where we have to add this XSLT mapping.

for eq.

RFC Interface SOAP Interface(WSDL)

loginid -


>isloginidexist0

1 -


>isloginidexist1

message <----


true/false

after above operation mapping we will get following requset

i.e.

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

after this we have to apply our XSLT mapping so how to proceed further .

please replay.

former_member854360
Active Contributor
0 Kudos

Hi,

Add the XSLT mapping in operation mapping in 2nd position.

1)Graphical mapping

2) XSLT mapping

So your operation mapping will contain two mapping in the above mentioned sequence.

Former Member
0 Kudos

Hi Debashish,

I followed the steps told by you.

now i am getting error saying only one top level element is allowed in XML document.

former_member854360
Active Contributor
0 Kudos

Hi,

you will get this error beacuse in your case output has two root level node

<isLoginIdExistin0>xyz</isLoginIdExistin0>----


rootnode

<isLoginIdExistin1>1</isLoginIdExistin1>----


root node

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> -


Here only one root node

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>----


Here only one root node

Former Member
0 Kudos

HI Debashish,

What can i do in this case.

How to Proceed ?

former_member854360
Active Contributor
0 Kudos

You can check with your Webservice Team whether they are expecting the request in that format.

Option: You can create the SOAP Envelope using XSLT mapping itself and in receiver Communication channel select Do not use SOAP Envelope.

Create below structure from mapping itself.

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

<soap:Envelope 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">

<soap:Body>

<isLoginIdExistin0 xmlns="http://netpricing">xyz</isLoginIdExistin0>

<isLoginIdExistin1 xmlns="http://netpricing">1</isLoginIdExistin1>

</soap:Body>

</soap:Envelope>

see this

Former Member
0 Kudos

Hi Debashish,

I am new to xi and i am using the XSLT mapping given by you, i seen the link provided by you but still not bale to

create valid XSLT with soap envelop.

can you please help mi out.

Thanks,

Swapnil

Former Member
0 Kudos

Hi ,

can anyone help me to solve the mapping issue .

Former Member
0 Kudos

Hi,

I have used XSLT mapping for my SOAP quest and received the following response.

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

- <soap:Envelope 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">

- <soap:Body>

- <GetRFCResponse xmlns="http://www.webserviceX.NET">

- <GetRFCResult>

<EmailAddress>TEST</FromEmailAddress>

<FirstName>Dennis</FirstName>

</GetRFCResult>

</GetRFCResponse>

</soap:Body>

</soap:Envelope>

I need to map this response to RFC response and the desired output should be as below.

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

- <ns1:Z_TEST_MAIL.Response xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<EMAILADDRESS1>TEST</EMAILADDRESS1>

<FIRTNAME1>Dennis</FIRSTNAME1>

</ns1:Z_TEST_MAIL.Response>

Could you please let me know the XSLT mapping for this?

Thanks

Tony

Answers (2)

Answers (2)

Shabarish_Nair
Active Contributor
0 Kudos

/people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1

/people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2

Ideally if you are using the WSDL itself for your mapping it should not give you this issue.

Can you elaborate how is that the structure is changed in your mapping?

Former Member
0 Kudos

Thanks for your reply.

at receiver end expected request is in following format :

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

<soap:Envelope 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">

<soap:Body>

<isLoginIdExistin0 xmlns="http://netpricing">xyz</isLoginIdExistin0>

<isLoginIdExistin1 xmlns="http://netpricing">1</isLoginIdExistin1>

</soap:Body>

</soap:Envelope>

here it is not having any root node but in my case when i am uploading wsdl in external defination am getting

isLoginIdExistRequest

isLoginIdExistRequest <----


unwanted tag

isLoginIdExistin0

isLoginIdExistin1

so my request format changes to

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

so how can i ignore this tag in request .

Former Member
baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use XSLT mapping or Java mapping to achieve this.

Former Member
0 Kudos

Hi Bhaskar,

we are having the problem with the root element which we dont want in our request as shown below.

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

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> <----


do not want this tag

<isLoginIdExistin0>xyz</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

i think it is not possible using any mapping as per my knowledge , can you please provide any example which we can refer .

former_member200962
Active Contributor
0 Kudos
i think it is not possible using any mapping as per my knowledge ,

Your requirement needs JAVA mapping....message mapping will add namespace prefixes and also cannot generate the WSDL as required (with SOAP envelope) by the end system

Former Member
0 Kudos

HI Abhishek,

I tried this with ABAP Mapping but as at recevier end they want only two child element without any parant.

so am not able to figure out this how to ignore the parent .