Receiving XML file

I am now using TEST->Send XML File to test receving an XML file from client side into SAP BC.

Is there any other way to receive XML?Is the way i am using now correct?

I am sending an XML file the the BC service.

The flow starts with StringToDocument then DocumentToRecord.

If i choose TEST->Send XML FIle, then i will get xmldata,$filestream and $fildata missing.

If i choose TEST->Run In Browser, it wil prompt me for XMLString whereby i cannot load my XML file but have to copy the codes and paste it into the text box. However, i found that the data does not go into my record, causing my service to fail.

Is there other way to stimulate receiving XML data?

Thanks.

Sue,

Test → Send XML File… transforms your XML file into an XML node, which is a Java object. If the service you’re testing actually expects an XML string, then ONE of the things you can do is:
(1) Create a wrapper FLOW service that accepts an object named ‘node’ as input
(2) From the wrapper service, invoke pub.xml:xmlNodeToDocument, followed by pub.xml:documentToXMLString This will convert the XML node to an XML string named xmldata.
(3) In the third and last step of your wrapper service, invoke the service you’re trying to test and map xmldata to the XML string field of your service (from your message, it looks like your service also calls the variable xmldata.)
(4) Finally, instead of running Test → Send XML File… on your main service, run it on the wrapper service

Let me know if this works for you.

  • Percio

Thanks Castprob,

The method that u suggested did work, thanks!

However, since i am in a project, the service flow should not be changed since it is done so in first phase of the project. Therefore, my focus is more to pumping in the data to suit the flow.

I wouldn’t hit the “xmldata, $filename, $fielddata is missing” error if i use TEST->RUN IN BROWSER.
At RUN IN BROWSER, i copied the whole xml document code into the text box and run.

My service flow is as follow:

Pipeline IN :xmlString
StringToDocument
Service In : xmldata
Service Out : node
Pipeline OUT : node

Pipeline IN :xmlString (record)
DocumentToRecord
Service In :node
Service Out :boundNode(record)
Pipeline OUT : DPInbound(record)

Pipeline IN : DPInbound(self defined record)
ZZUpload_DOWNPAYMENT
Service In : DPRec (self defined record that correspond to DPInbound rec)
Service Out : rfcstatus(self defined field)
Pipeline OUT : rfcstatus(self defined field)

My ZZUpload_Downpayment service works well by itself. But if i start testing the flow from the very beginning, then it cannot work. Seems like no data is being pumped in.

Thanks again

I’m not familiar with the StringToDocument and DocumentToRecord services you’re referring to, so it’s a little difficult for me to tell you what could be wrong. However, it looks like in your second step (DocumentToRecord), you’re mapping xmlString to node. I’m assuming you wanted to map node to node, no? See if that’s your problem.

  • Percio

Those built-in services were the IS 4.6 names for what are now called pub.xml:xmlStringToXMLNode and pub.xml:xmlNodeToDocument. By the way, if you want to quickly create a service that accepts an XML document you can use hit CTRL-N in Developer and choose Flow Service, then pick the “Receive an XML Document” option. That will generate a simple flow that will grab the xml document (from an object variable called “node”) and convert it to a document (called “record” in IS 4.6).

Mark

Finally it works for me!! Thanks guys!!!

What i did was to ensure the xml file goes into my program as a string if i use StringToDocument followed by DocumentToRecord.

Alternatively, i let xml file goes in as a node by using DocumentToRecord directly.

Hi All,
I’m facin a problem on the same lines.
I have written a flow service which has to receive an XML file from a Siebel system. Siebel sends a http post to my service.
Problem with the request sent is that there isn’t any variable pointing to the XML data, so theres no way for the service to receive the XML.
Is there a way to receive ‘anonymous’ XML in flow service.
Any clues here will be highly appreciated.

thanks