cancel
Showing results for 
Search instead for 
Did you mean: 

XML data in the web service request structure

Former Member
0 Kudos

Hello folks,

The client is demanding that i should design a web service that should contain a single field which is capable of taking an xml message which contains all the data of my PO creation. Which data type i should take for that input field because if i make it as string and check the same in xml spy by passing the whole xml message in the input field, it doesn't take the xml message. Also i need to take the same XML message through RFC to ABAP and parse it there to create a PO in the database with the data of xml message. But how to take such a big input message in RFC.

So what could be the possibilities to do the same.

Please help.

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

On the sender side you are hosting webservice and you are in the driving side, why don't you request to send the message as per your need?  on the receiver side if you have the same requirement you can pass entire xml as string  in RFC using graphical function copy xml subtree as discussed in the blog

http://scn.sap.com/people/jyothi.anagani/blog/2010/06/17/convert-the-input-xml-to-string-in-pi-71-us...

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks

I have made it as a SOAP to FILE scenario and able to collect all the xml message in a single tag.

But i don't know whether it helps or not.

Also i can't use proxy as the relevant configurations are not done. Can there be a possible way out use RFC or something else.

Former Member
0 Kudos

Hello,

Thanks for your prompt reply.

I will try the same but without taking the xml message into the ECC side, how i will be able to take the data for PO creation into the database using BAPI_PO_CREATE1 as XML message contains all the data, which client is sending in a particular field of a web service.

Also the answer to the Basker question is this, that i can't request the client to provide me the web sevice according to my needs as the client is using the third party system which is already prepared. They already have their system generating the xml messages when new Purchase order is created. And also they consume the web service of a particular type containing a single field in which thy can send me the XML messages.

Thanks

former_member184681
Active Contributor
0 Kudos

Hi,

Here is how I would approach your scenario:

1. On the sender side, create a Service Interface with just one field, that will receive the input XML (as you probably already did). The trick is, encapsulate the whole XML on the sender side in the CDATA section, like this:

<![CDATA[<root><node1><yourXmlDataHere/></node1></root>]]>

2. Calling RFC on the receiver side isn't really an advisable solution for data of variable length. Instead, use an inbound proxy. Simply pass the XML string data to the proxy, and parse the input in the implementing class in ECC.

By the way, why do you want to parse the XML in ABAP in ECC, instead of working with it in PI? Is there any particular reason for that?

Regards,

Greg