cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP to File scenario with PDF File

Former Member
0 Kudos

Hello everyone,

I have the following requirement

SOAP (with pdf attachment) -> SAP PI -> File directory (as PDF File)

Now, what I need to do is to receive a SOAP call with a pdf file as attachment, and then put this pdf file in a SAP PI directory with NFS (File System), rhis is my first time to use PDF files, that´s why I kindly ask for your help and support on implementing this scenario, thanks in advance for your answers.

Regards,

Julio

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi,

if your requirement does not require the original payload from SOAP sending system, then use payload swapbean module in receiver file channel with correct configuration to treat attachement as payload. That's all

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Hello Praveen, thanks for your answer,

my requirement just changed, I need to send to an Oracle function or procedure both the original payload and the pdf file, so the answer is yes, I need the original payload and the pdf file, but it´s not for file system anymore, we already have some interfaces working receiving an email with attachment and taking the attachment with the PayloadSwapBean module to send the attachment to Oracle, now the difference is that I need both the attachment and original paylod, can this still be done with this method?, thanks again for your answer,

Regards,

Julio

former_member181985
Active Contributor
0 Kudos

Hi Julio,

You have to collectively use my blogs as reference to achieve your requirement:

http://scn.sap.com/docs/DOC-26528

http://scn.sap.com/community/pi-and-soa-middleware/blog/2010/03/28/sap-xipi-storing-binaries-images-...

Read attachment (PDF) via mapping (preferably a java mapping) and convert to hexadecimal for stored procedure call.

So you need to have a structure for JDBC call for both payload and attachement as per SAP help

http://help.sap.com/saphelp_nw2004s/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

i.e., StatementName1(or)2 and StatementName5

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Thanks Praveen,

will got thru them and update with results.

Regards,

Julio

Former Member
0 Kudos

Thanks a lot Praveen, I did used your blogs and made it work.

Regards,

Julio

former_member181985
Active Contributor
0 Kudos

Glad to hear Julio

One question, did you managed stored procedure call (with BLOB as input) without extra one byte in hexadecimal equivalent for binary file(PDF) ?

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Thanks Praveen,

I did it as your blog indicates, stored procedure with BLOB as input and include extra byte with java mapping in hexadecimal.

Altough, I did try everything else, not because I did not believed in your blogs hehehe, but because I wanted to get the full experience of testing, so I did try direct insert of binary file string and got overflow statement error in the SQL statement as you mentioned in your blog, cause oracle replied that wasn´t able to understand the SQL statement because it was incomplete, so then I did direct insert of hexadecimal in BLOB table field and it worked, but the next system was not able to understand it and they did not wanted to adjust code, so I did the stored procedure with BLOB input receiving hexadecimal and then convert it to binary or raw and then insert on table BLOB, so it got inserted as PDF binary string file.

Regards,

Julio

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Do you want to read contents of PDF file and do some conversions before saving it as file in folder or just want to save as it is in the folder without any mapping?

Former Member
0 Kudos

Hello Nishu,

thanks for your answer, no reading of pdf content is required, just saving it as pdf file in File System folder.

Regards,

Julio

former_member184789
Active Contributor
0 Kudos

Hi,

There is an option of keeping attachments in the Sender SOAP adapter. You can select it & also you have to tick the option of reading attachments in your operation mapping.

Hope this helps..

Former Member
0 Kudos

Hello Adarsh,

thanks for your answer, I will test this and let you know about the results, another question, by ticking the reading attachments option in operation mapping I will be able to create a receiver file including only the pdf attached to message?, and how do I see it in operation mapping? as a field? or something else?

Regards,

Julio