cancel
Showing results for 
Search instead for 
Did you mean: 

sap pi to http post

Former Member
0 Kudos

Hi,

The target url contains the form to upload s file.

here the source code of target url (http://test.xxx.xxx.org/test/):

<form action="Upload.ashx" method="post" enctype="multipart/form-data">

<input type="file" name="file" />

<input type="submit" />

</form>

how to confirgure the HTTP receiver adapter to upload the file to the taget system.

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

HTTP does not support multipart. You might have to try prolog and eplilog.

Have you seen this [link|;? This might be helpful.

Former Member
0 Kudos

Hi,

I already saw that link, this doesn't answer my question. If I have to use prolog or epilog do you have any reference or example for that?

In that link one reply says "I am not using epilog and prolog also,

as i am simply sending the file as such"

For me also the same case, i need to send the file, will this work by just configuring the HTTP adapter to the target url or should I need to use java code?

In my case its HTTP only not https.

Thanks for your reply

former_member181985
Active Contributor
0 Kudos

I hope you are sending some binary data to target HTTP based system. Since SAP HTTP adapter doesnt support Multipart mime content, So may be you have to use some BASE64 encryption logic to post the data to target HTTP system. However, the target HTTP system should have a logic to decrypt the information to binary format.

Please check this link: https://wiki.sdn.sap.com/wiki/display/XI/SendingBinaryDatatoInboundPlainHTTPAdapterinXIand+PI

you have to perform the below steps.

Encrypt the binary data to BASE64 during mapping

(ii) post the data to target HTTP system.

(iii) BASE64 is a open a standard and hence target should include decryption logic first before they can perform actual business logic.

Answers (3)

Answers (3)

Former Member
0 Kudos

hI Shankar,

i have a similar requirement. Can you please let me know how you achived this?

stefan_grube
Active Contributor
0 Kudos

You have to understand the MIME type multipart/form-data

See this: http://www.w3.org/TR/html401/interact/forms.html

especially this: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2

This is not easy to understand but it shows you, how you have to build the HTTP stream.

You can use prolog/epilog are Java mapping.

In principle you have to build the HTTP stream around your file.

I have written a blog to show how to create a multipart message for mail adapter, which is of course something different, bt it shows the princples of a multipart MIME.

/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-emails-with-attachment-with-help-of-java-mapping

I hope that helps.

Shabarish_Nair
Active Contributor
0 Kudos

multi part support is only available from PI 7.3