What data is in the XML? Based on the error message it looks like objects that are not passable via XML are being used. There should really be no reason to be trying to pass the two object types listed using XML over HTTP. Can you share more about what you’re trying to accomplish?
I am trying to send the xml data to the test server and from there sending it to the AS400.
The above errors i can see in the test server where i am trying to send the xml data.
Problem resolved. Since we were getting large files i had this problem sending the data using HTTPPost. I have used node iterator and have send each node using HTTP to my test server. Everything works fine now.
I’m using pub.client.http to send xml from one service (service1) to another (service2).
Service1 simply takes and an xml file and sends it to service2.
pub.client.http variables are set as follows:
url=http://localhost:5555/invoke/test.folder/testSvc
method=post
loadAs=bytes
Content-Type=text/xml
user=Administrator
pass=manage
After the call, I get a 403 response. Looking at the server log I see “Copy failed: No source data available: to=/node, from=/input”
Service2 has a node (input) as the input. It takes input and does a xmlNodeToDocument. That’s where the exception is triggered, but it seems like service2 never successfully gets in the input.
I get the same error if I test service2 through the browser. It works if I do an inline call from service1 to service2 and if I test it through developer/Test/SendXMLFile. But, I’m testing functionality so I really need to use http.
My test data looks like this:
<?xml version="1.0" encoding="UTF-8"?>
1
1111
1867
george
washington
5555555555
If it is a large file then there is a problem with HTTP service, so I wrote the xml to a file using writetofile service and then called this xmlfile using [FONT=ArialNarrow,Bold][SIZE=4]
pub.xml:loadXMLNode service.
[/size][/font][FONT=ArialNarrow,Bold][SIZE=4]
[LEFT]
Or second option: You can use XML node iterator and send each node at one time to the 2nd service using HTTP. You can get a sample package in wmusers how to use node iterator.[/size][/font]
Why are you using an HTTP post to send an XML file from one Flow service to another? This is not necessary. If you need to test service2 by sending an XML file use Developer’s Test->Send XML File menu option to do this.
I’m just testing functionality. I’m having each simulate an external system. Eventually, one service will send a request to an external system and expect a response in the same session. The other will receive a request from an external system and send a response in the same session. Basically, I’m just using the flow services to test each other. However, if I can’t get them to work together, then I don’t have much hope of being able to interface with the external systems.
This is pretty basic stuff and is covered in the built-in services guide for pub.client:http as well as some references on sending XML to a service in the Developer’s guide.
How are you mapping your XML doc into the pub.client:http service? Did you choose “text/xml” as the content type?
If I hard code the xml and the \r\n into xmldata and then map xmldata to the data/string input of pub.client.http everything works fine. But, since this is hardcoding the input, I can’t do this.
However, if I use variable substitution (%xmldata%\r\n), pub.string.concat, or pub.string.makeString, it stops working.
I’ve already searched this site, the built-in services docs, developer docs, etc.
Format 1 – works
<?xml version="1.0" encoding="UTF-8"?>
1
1111
1867
george
washington
5555555555
\r\n
Format 2 (string substitution turn on) – doesn’t work
%xmldata%\r\n
With either format I use, the pipeline values looks the same, so I’m guessing wm does something different in the special characters that I can’t see.
I experimented with this issue by writing two pairs of services:
tryHttpPost —> receiveHttpPost
and
tryHttpGet —> receiveHttpGet
The try version sends an xml string to the receive version. Both work ok.
Further, I tested the receive services by mean of a browser (url for GET, and a form for POST). Both receivers worked ok.
The services are simple, but too difficult to explain in this thread. I have attached the packages to this thread.
The packages’ pub folder contains html files that can be used to run the receive services via a browser. The services can also be run with Developer. tryHttpGet.zip (9.99 KB) tryHttpPost.zip (10 KB)
I’m doing almost the exact same thing as you. If I start with the tryHttpPost, everthing works fine. However, if I call tryHttpPost from another service and the data happens to have been in a node or document at one point it doesn’t work.
Please take a look at my small project. Use the starter as the entry point and see what results you get.
I added a service called preStarter which calls starter with a node as input. It appears to work ok. I also renamed your document type from testDoc to testDocWrapper, to avoid confusion between the doc type (originally testDoc)and its top level element (also testDoc)
I think you may have been confused by the nesting of the doc (at least I was).
The debug log looks like this (note, I also changed the server to localhost):