Hello forum,
we are using webMethods IS 6.5 SP2. I am trying to receive a file via HTTP Post into IS and then have a flow process set up to process the file. My flow process works if I use GETFILE to retrieve the file, but when I do an HTTP Post (I have set up a small flow service to do the HTTP POST) I see the data onbly as “Null name” in the flow and it does not process. Here is what the file kind of looks like:
301874
03708
1/28/2010
1/28/2010
20000
116011
26.43
.........(some more values and two loops>
I set up NODE as input of the flow and then I have a flow step nodeToDocument. I tried different settings on the Content-Type in the headers of HTTP Send (“text/xml”, “application/text”). But all I accomplish is that it shows up like this in the flow which I see when I savePipeline to file after receiving the file:
Like I said If I load the file manually via GetFile and do an XMLStringToXMLNode then the NodeTODocument step works perfectly, so I must have something wrong in the way I receive the HTTP Post.
Thank you for your time and help.
I Well, I just wanted to give an update. I did some more trial and error with the process yesterday and found a way to make it work. I set the Content-Type for the HTTP Post to “text/plain” and then did streamToBytes and then bytesToString and then I had the incoming data in a state where I could work with it.
If you do an HTTP post with content-type set to text/xml and you are posting valid XML, you should see a node variable in your pipeline. Instead of testing with getFile, you should be able to test by going to Test > Send XML File… from the Developer menu. This will generate the node variable you need.
My guess is the issue is with the test service that is doing the HTTP post, not with the service being invoked. Can you provide details of the service doing the pub.client:http call?
In one of my flow service i invoking a different flow service using pub.client:http. I am able to send document to the different service. My question is how to get back the response as i it is a synchronous call.
I do have a similar requirement which is using a simple java client where in do a http post with the the payload set as a request parameter. But the service pub.xml.xmlstringToNode always report one of the xmldata,$filestream…must not be null. if anyone have a resolution please post.
Yes the content type is text/xml. if you have a sample flow which accepts the a xmlString request and produces xmlString response can you please share it.
The FLOW service should specify a *node object as its input. IS will automatically do the xmlStringToXMLNode behind the scenes for you and pass the node to your service. The “XML Services Developer’s Guide” describes this and provides additional detail.
reamon thank very much it worked. I am able to manuplate the XML as required. On a highlevel i have to send back the XML string to the http client as response. I am getting the below output as reponse where in the reponse paylod is embeded in side Values element and also the xml tags are escaped.
In general the flow steps are
queryXMLNode
2.get the values of the request element
3.call a Storeprocedure
4.Result of Storeprocedure to a Document
5.Convert the Document to XML String.
6.xmlString to xmlNode.
After step 4: The whole payload XML (ITEM_SEND) will be in a *body variable (Values/value/*body). You can just map this to a String and then pass this String to step 6 and ignore step 5. Here you will just have the response payload.
Thank you all for your time, was able to get the desired result using pub.flow.setResponse & pub.flow.setReponseCode services, this gave me only the XML payload as output.
I would like to understand where to we put in the xpath /Values/value/*body isthis in the “setValue” with variable substitution.