cancel
Showing results for 
Search instead for 
Did you mean: 

how to map XML file to various of object in the RFC

Former Member
0 Kudos

hello

I recieve XML file (not devided to elements, but XML file)'

and I would like to map it to a RFC that has various object.

I there a way to do it?

if it involve a java code, does any one has a written code example?

THX

Kfir

Accepted Solutions (1)

Accepted Solutions (1)

former_member194786
Active Contributor
0 Kudos

Hi Kfir,

<<<<not devided to elements, but XML file>>>

<<<RFC that has various object>>>>

Can you please elaborate your question? Also if possible can you provide the source structure?

Former Member
0 Kudos

thanks for the reply

my source XML response will be looking something like this (it will be reponsed in a long string):

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

<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<SOAP-ENV:Header>

</SOAP-ENV:Header>

<SOAP-ENV:Body>

<status>

<retCode>00</retCode>

<retCodeDesc>OK</retCodeDesc>

<rRobjectId>09002347802d2981</rRobjectId>

<rFileSize>7</rFileSize>

<rTotalPages>1</rTotalPages>

</status>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

my RFC is:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">

<xsd:element name="ZRFC_SET_DOCUMENT.Response">

<xsd:complexType>

<xsd:all>

<xsd:element name="RETCODE" type="xsd:string" minOccurs="0" />

<xsd:element name="RETCODEDESC" type="xsd:string" minOccurs="0" />

<xsd:element name="RFILESIZE" type="xsd:string" minOccurs="0" />

<xsd:element name="RROJECTID" type="xsd:string" minOccurs="0" />

<xsd:element name="RTOTALPAGES" type="xsd:string" minOccurs="0" />

</xsd:all>

</xsd:complexType>

</xsd:element>

</xsd:schema>

former_member194786
Active Contributor
0 Kudos

Hi Kfir,

Do you have any xsd for the xml message that you have? Use the xsd in the mapping and then you can send the request to the RFC using the request mapping.

Regards,

Sanjeev.

Former Member
0 Kudos

I have a WSDL (forgot to mention that the scenario is sync RFC2WS).

in the request I am mapping each object, but in the response I have a long string, which is an XML file, and I would like to map specefic attributes from the string to a specific parameter in the RFC.

if that what you meant, I will appreciate if you have an example or more details to know how to do it.

Thanks

Kfir

former_member194786
Active Contributor
0 Kudos

Hi kfir,

In that case you can use the following blog by Michal to pass your xml as a string:

It will help you.

Regards,

Sanjeev.

Former Member
0 Kudos

this I know.

I would like to know if there is the same way just the other way around.

to recieve a long string and map from the string to RFC?

wilsonrsantos
Active Participant
0 Kudos

Hi Kfir !

I think that you need to define a Message Type like this:

Name of the Message Type : status

( very important: remember to let the field XML Namespace blank - this field is below of the field when you set the data type used to define the message type)

Structure:

<status>
    <retCode>
    <retCodeDesc>    
    <rRobjectId>
    <rFileSize>
    <rTotalPages>

So, you can use it in the Output Message field of the Message Interface Inbound Syncronous that is being used to call the WebService.

Doing that, you can use this Message Type in the Message Mapping that will map the return of the WS to the return of the RFC.

Did you understand how to do what I explained ?

You said that the response of the WS will be in a string, but the string(according to your example XML), is a XML content, so, if you design a message type adequate to the XML content in the string, this string will be recognized inside XI like a XML message and you will get to map it.

Thank you for your attention,

Wilson

Edited by: Wilson Santos on Jul 14, 2008 4:58 PM

Answers (0)