We need to send some messages to our partner. Both uses webMethods IS server. We use version 6.5 and they use 8.
We need to call our partner service using pub.client:http and pass data as byte array in a variable named ‘xmldata’.
These are the steps I performed.
Created the document
converted the document into xmlstring
converted the string to bytes
Called pub.client:http service as post mapping bytes to data/bytes
My issue is how do I pass the value into a variable name.
When I do not set a headers/content-type then I see the incoming variable name as “<?xml version” with string data.
if I set the headers/content-type to ‘text/xml’ then the incoming variable name is ‘node’ but an immediate xmlNodeToDocument fails with the error “com.wm.lang.xml.WMDocumentException: [ISC.0042.9334] XML version must be 1.0”.
I tried to set the varible name under ‘data/args’ it sure passes the variable but without byte data in it.
Can someone direct me on where I am making the mistake.
Called pub.client:http service as post mapping bytes to data/bytes (what is the url are you invoking)
Also set a headers/content-type=text/xml and the receiving end/service will have *node object in the pipeline and downstream parsing
Your second option:
I tried to set the varible name under ‘data/args’ it sure passes the variable but without byte data in it.
–>did you set xmldata=%xmldata% (with variable substituion and make sure xmldata in pipeline and not dropped?)
headers/content-type=text/xml did give me a *node object at the receiving end. I was now also successfull in parsing the string. But I want the receiving end to be having a variable name ‘xmldata’.
I tried setting xmldata=%xmldata% with varibale substitution and found that it only worked when the data was a string. When byte is used the incoming service had a varible named ‘xmldata’ with a value ‘%xmldata%’ inside it. When you look at the http service you could see that the args variables can only be strings. I did not find a way to mention the datatype other than strings in it.
Call “pub.client,http” by setting following parameters
url = [url]http://ip:5555/invoke/eTest/aaa[/url]
method = get or post (as per requirement)
loadAs = byte
add new variable as “xmldata” with in the “data/args” and set the value of this using variable substitution (your xmlstring comes here). and just execute the service
Go to the service that you have called. You will be able to see two variable (xmldata & xmldataList) with your xml data.
You are not converting the string data into bytes during these steps. LoadAs bytes is not converting the data, its for the response value.
In this case I would be getting the input as string at the receiving end and that is not the one expected. They are expecting a byte array with a variable name xmldata.