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:
.........(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:
- <array name="Content-TypeList" type="value" depth="1">
<null name=" 301874 03708 08/24/2010 8/31/2010 20000 116011 26.43 M 528.60 ST snichola 98327 8.5000 14.0000 1 <ItemNo_CPIL>15702050 09.5000</ItemNo_CPIL>> <UOM_UM>LB</UOM_UM> <UnitsTransactQuantity_UORG>55</UnitsTransactQuantity_UORG> <LineNo_LNID>1</LineNo_LNID> <ItemNo_CPIL>42601504 09.5000</ItemNo_CPIL>> <UOM_UM>LB</UOM_UM> <UnitsTransactQuantity_UORG>20</UnitsTransactQuantity_UORG> <LineNo_LNID>2</LineNo_LNID> <CostCenter_MCU>3708111</CostCenter_MCU> <SeqNoOperat_OPSQ>1</SeqNoOperat_OPSQ> <RunLaborStd_RUNL>2.50</RunLaborStd_RUNL> <Description_DSC1>Press Easy</Description_DSC1> <CostCenter_MCU>3708207</CostCenter_MCU> <SeqNoOperat_OPSQ>2</SeqNoOperat_OPSQ> <RunLaborStd_RUNL>1.5</RunLaborStd_RUNL> <Description_DSC1>Collator Easy</Description_DSC1> " />
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?
I have a question similar to this one.
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.
Review the Built-in Services guide for pub.client:http. The output parameters are described there.
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.
Is the Java code setting the content-type header to text/xml? (assuming you’re trying to post XML)
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
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.
<?xml version="1.0" encoding="UTF-8"?>
I donot want the values elements but only the reponse payload as XML string, any input on this will be very helpful
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.