Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

janhess
2012-02-09 17:28:49

I think it only applies to binary data. Text should be ok.

Alexman
2012-02-09 17:04:25

Would be the same procedure to send an XML to a Restful Web Service or is there something better?

radugrigorovici
2011-11-10 11:52:18

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!

janhess
2011-11-10 10:02:25

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;

radugrigorovici
2011-11-10 09:27:16

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

janhess
2011-11-09 16:43:23

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.

radugrigorovici
2011-11-09 15:53:24

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.

janhess
2011-11-09 15:30:23

Should you not just specify it as a string?

radugrigorovici
2011-11-09 12:41:03

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

shong
2011-11-09 10:00:41

radugrigorovici wrote:

Hi Shong,

It worked. Thanks for your help!

Best Regards,
Radu

Good news, thanks for your feedback!

Best regards
Shong

radugrigorovici
2011-11-09 09:47:28

Hi Shong,

It worked. Thanks for your help!

Best Regards,
Radu

shong
2011-11-08 13:12:40

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

radugrigorovici
2011-11-08 12:52:55

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

Board footer

Powered by FluxBB