cancel
Showing results for 
Search instead for 
Did you mean: 

FTP to Webservice with base64 encoding

former_member185846
Active Participant
0 Kudos

Dear Experts,

I need to read a file from a FTP server and push it to a Webservice, without any major mapping (file transfer from FTP to Webservice). Whole file content should be mapped to a single field in the target WSDL as base64. I think this can be achieved by a UDF in the graphical mapping. Just wondering if that's the right approach or any other better alternatives available. Please suggest.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

smavachee
Active Contributor
0 Kudos

Yes, that's easiest way to achieve your requirement, if you are below PI 7.1, you can refer

Whole Payload to a XML field

Or if you are using PI 7.1, find below blog by Jyothi Anagani..

Whole Payload to XML field

Hope it help.!

Regards,

Sunil

Answers (1)

Answers (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

I need to read a file from a FTP server and push it to a Webservice, without any major mapping (file transfer from FTP to Webservice). Whole file content should be mapped to a single field in the target WSDL as base64. I think this can be achieved by a UDF in the graphical mapping. Just wondering if that's the right approach or any other better alternatives available. Please suggest.

I guess you have to use java mapping for this. In your sender CC, no field content conversion would be required so that the file would be read as-is (as a text file). Build the Soap Structure using the same Java mapping.

Hope this helps,

Mark

former_member185846
Active Participant
0 Kudos

Thanks, Mark. Do you mean module?? Do you've any instant code for this?

smavachee
Active Contributor
0 Kudos

Check the links given in my previous reply for "code". Module customization is not required for your requirement.

For Receiver SOAP (base64 encoding) requirement, refer these links..

Hope it helps.!

Regards,

Sunil

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Joe,

Simplest would be using Java Mapping, although I have no code for reading text files, you could easily code this Here is the API for PI 7.1 Java Mapping http://wiki.sdn.sap.com/wiki/display/XI/Using+PI+7.1+API+for+Java+mapping

Hope this helps,

Mark

former_member185846
Active Participant
0 Kudos

Wiki seems to be down for a while. Meanwhile, I was trying to create an UDF using the external commons-codec-1.4.jar. I downloaded the jar file to my desktop and placed it inside the folder path (com/test/encoding/) and imported the jar file to PI 7.31 as imported archive ( i can see the path as com/test/encoding/ in imported archive.. (file name com.zip)..but, when I use the import statement import com.test.encoding.*, its throwing the error package doesn't exist.. not sure what's wrong with this (I'm referring the Imported archive in archived used of function library too)...pls suggest.. thx

former_member185846
Active Participant
0 Kudos

I could acheive this with the UDF itself, though I developed a Java mapping and tested it successfully..thx everyone for your valuable inputs