You are not logged in.
Announcement
Unanswered posts
|
I think it only applies to binary data. Text should be ok.
Would be the same procedure to send an XML to a Restful Web Service or is there something better?
janhess wrote:
Use a tJavaRow for the encode/decode.
To enccode
String s = new sun.misc.BASE64Encoder().encode(input_row.Image);
//System.out.println("Text Decryted : " + s);
output_row.Image = s;
To deccode
byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(input_row.Image);
//System.out.println("Text Decryted : " + s);
output_row.Image = buf;
Thanks Jan! Now it works.
Best Regards!
Use a tJavaRow for the encode/decode.
To enccode
String s = new sun.misc.BASE64Encoder().encode(input_row.Image);
//System.out.println("Text Decryted : " + s);
output_row.Image = s;
To deccode
byte[] buf = new sun.misc.BASE64Decoder().decodeBuffer(input_row.Image);
//System.out.println("Text Decryted : " + s);
output_row.Image = buf;
janhess wrote:
Ah! I think you need base64 encoding. I had this problem sending binary data from a webservice. Had to encode it to send from webservice and decode on receipt.
How can I encode it? Is it a componet which I have to use or encode in java?
I should mention that I'm not a java programmer.
Regards,
Radu
Ah! I think you need base64 encoding. I had this problem sending binary data from a webservice. Had to encode it to send from webservice and decode on receipt.
janhess wrote:
Should you not just specify it as a string?
I did that at first, but with similar results.
Inside the talend job it seems to be ok, it has the right length, but then the webservice receives it truncated at 6 characters.
Should you not just specify it as a string?
Hi,
The file gets to the WebService in a wrong format. I guess it's not byte[] when send from WebServiceInput. I specified byte[] in FileInputDelimited's schema, and also changed the parameter expression in WebServiceInput to (byte[])globalMap.get("file_content"), but still, the received file is corrupted (is csv, xlsx,..).
Regards,
Radu
radugrigorovici wrote:
Hi Shong,
It worked. Thanks for your help!
Best Regards,
Radu
Good news, thanks for your feedback!
Best regards
Shong
Hi Shong,
It worked. Thanks for your help!
Best Regards,
Radu
Hi
Store the content into a global variable and get it on the parameter list of tWebserviceInput, for example:
tFileInputDelimited--main--tJavaRow
|
onsubjobok
|
tWebserviceInput--main--tLogRow
on tJavaRow:
globalMap.put("file_content", input_row.content) //content is the column name on tFileInputDelimited
on tWebserviceInput, set the value of parameters as below:
(String)globalMap.get("file_content")
Best regards
Shong
Hi all,
I'm trying to send a file to a Webservice, along with other parameters. For reading the file I use tFileDelimited with no separators, then pass the content to tWebServiceInput. I cannot figure out how to refer that content in the parameter list from tWebServiceInput for sending it to the WebServer.
Regards,
Radu