I am using put.client:http to post string to client. I have “ISO-8859-1” in the service parameter. But they are receiving it ast UTF-8. I have tried sending it to myself and do see data as ISO-8859-1.
Is there anything to trace the http transmission? Other thoughts?
[quote]
encoding String Optional.
Character set in which the URL data parameters are
encoded (args or table and/or string). Encoding is required to
correctly convert the String object to bytes when generating the URL
for a post. Specify an IANA-registered character set (for example,
ISO-8859-1).
If this variable is null, the default JVM encoding is used. Because
string is used in the body of the post and not used for building the
URL, you do not need to specify encoding for the data parameter
string.
{/quote]
So, if you are passing the data to be transfered over http in the ‘string’ variable the behavior you see is as expected.
Are you passing the data as bytes? if not you should first convert the string to bytes and pass it to http service. We have observed that passing as String and providing the encoding parameter does not help the cause.
the remote IS service which handles the request should have a node object as input,which you can convert it into string using bytesToString.
try doing it in the above mentioned way and debug the remote service and see what is there in the pipeline.
include the string which you want to send, as a field of a document in the sender’s side and map it to data/args of pub.client:http.and at the receiver’s side, the string name which you have used at sender’s side should be the input(not the whole document).
Source: stringToBytes (input as string, say the value is “Test” and then convert to bytes)
pub:client:http (in args, I am passing the above bytes)
Target: bytesToString (I get the node as Test and value as null. And this is where the problem is…)
I hope I am clear or I can attach an export for these 2 flow services…
As final option for debugging put a getTransportInfo,savepipelineToFile services in the target service and disable all the further flow later restore the pipeline and check what are the values showing under the transport/http.