on 08-03-2011 12:17 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
<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>
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>
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.
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
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
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
/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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 .
Pl use XSLT exmaple in link ahead http://www.way2sap.com/sap-article/step-by-step-simple-approach-for-xslt-mapping-807/
Use XSLT mapping or Java mapping to achieve this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 .
User | Count |
---|---|
93 | |
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.