XML What is the ideal method to pass XML data

Hello All,

I would like to know what is the ideal method to pass XML data to webMethods which will execute my flow service directly. The web developer ask me how he should pass the XML data:

  1. FORMS collection. <form> element. Something like <input>
  2. Or the entire XML message.

He’s going to do an HTTP post to execute my flow service. If we chose option 1, my flow service input will be the variablename? If we chose option 2, my flow service input will be a single string? I tried option 2 but wasn’t able to get it working properly. In my flow service, I define a single string as the input and then I do a “stringToDocument” but it failed. I’m just confuse how everything is suppose to work. Please advise.

noyb,

If you are using option2 then make sure the following:

1)The receving flow service input should be (Node) object and then invoke XMLNodeToDocument service for parsing the XML file.
2)your client program while sending the XML string should set the Content-type=“text/xml” and do http post to WM.

Regards,

The above response is for Option1.

Thanks RMG. Where can I find the service XMLNodeToDocument. Is it in WmPublic package?

If you are using webmethods4.x server then,

In WmPublic package look under the web folder for(pub.web:documentToRecord).This service is deprecated in 6.0 version

If you are using webmethods6.x server then,

In WmPublic package look under the xml folder for(pub.xml:XMLNodeToDocument).

HTH,

Hi,

The Edit/Find option in 6.x is great.

Was this available in 4.x?

Regards

Alphan

FYI,

I defined the Input of the service to be executed as an object and I called “node”. I then call the “documentToRecord” service. Is there correct?

yes,you are in right path.

Regarding XML file its valid and you can also test this by opening it in browser for validness.

HTH,

Thanks RMG. When I debug, using the save/restoreFromPipeline, when can’t I see the node in the results tab? First I enable the saveToPipeline service…I then I post the XML…I then disable the saveToPipeline and enable the restoreToPipeline (I made sure the filename is the same)…but I don’t see the node in the results tab. What’s the deal :-)?

How you are posting the XML to wm?While doing http post to WM make sure you set the Content-type=“text/xml”.

And for testing you can also send the XML file to flowservice using developer tool by “Send XML File” option located under the Test Menu.

HTH,

RMG, I made sure the Content-type=“text/xml”. I know my flow service works but I just wanted to trace through the steps just to analyze the pipeline of each step in my service. Without the restoreToPipeline, the test works. I post the XML data and got the response back as I expected. I just want to trace through the steps and see the results after each step in my flow service.

RMG, thanks for the advice on “Send XML File”. I guess that would work too. I thought I could use the saverestoreToPipeline for debugging purposes. Thanks for the quick response.

I don’t have any clue why the save/restore pipeline steps are not working which it supposed to show node object in the pipe.Any way continue with Send XML File option for further process.

Regards,

saveToPipeline doesn’t work in this case is because the ‘node’ noyb trying to save is an object that is not “serialization”, Java term meaning can’t be saved to disk, thus also the problem when trying to’restorToPipeline’.

Do the savePipeline after the XMLNodeToDocument/documentToRecord call and the complete file contents will roundtrip. Assuming the node object is not used for anything else, it should be dropped before the savePipeline call.