cancel
Showing results for 
Search instead for 
Did you mean: 

File to HTTP_AAE with Attachment

sherin_jose4
Participant
0 Kudos

Hi,

My scenario is to send a CSV file to an external system as a HTTP attachment.

I do not have a mapping for this scenario, so created a File adapter in Sender and a HTTP_AAE adapter at the receiver with only Configuration objects.

When i run the scenario, i can see that the CSV file gets into the Payload Body and is transmitted to the end system.

My requirement is to send the CSV file as an attachment itself.

I have even tried using the Payload swap bean, but still the payload gets into the body and is being passed.

Any help on this would be much appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Can you tell me, what you mean by "http attachment"? In other words: How should the http stream look like? I think you have to clarify this with the responsible guys from end system.

sherin_jose4
Participant
0 Kudos

Hi Stefan,

I am trying to do HTTP POST to an end point URL along with passing a few parameters. Please find the below HTML code which works perfectly fine using a browser and i need to achieve the same using PI.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">

<title>Direct access - File upload</title>

</head>

<body>

<h1>Direct access - File upload</h1>

<form method="post"

enctype="multipart/form-data"

action="https://XYZ.ariba.com">

Event: <input type="text" name="event" value="Import Batch Data"><br>

<input type="radio" name="fullload" value="true">Full Load<br>

Password: <input type="password" name="sharedsecret" value="XYZXYZ"><br>

Client Type: <input type="text" name="clienttype" value="DataTransferTool"><br>

Client Info: <input type="text" name="clientinfo" value="Custom ITK Download Form"><br>

Client Version: <input type="text" name="clientversion" value="1.0"><br>

File: <input type="file" name="content"><br>

<input type=submit value="Submit Post">

</form>

</body>

stefan_grube
Active Contributor
0 Kudos

There is no standard why to achieve this. If you want to use exactly the same access to post your data, you have to simulate the whole HTTP stream with multipart/form-data Here is an example how this could look like: http://stackoverflow.com/questions/4526273/what-does-enctype-multipart-form-data-mean The HTTP stream can be created with Java Mapping. A had a similar task for mail adapter, described here: http://scn.sap.com/community/pi-and-soa-middleware/blog/2015/09/04/create-email-with-body-and-attach...

former_member186851
Active Contributor
0 Kudos

Hello Sherin,

I doubt this bean wont work for HTTP_AAE Adapter

only for mail adapter

http://help.sap.com/saphelp_nw73/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm

Please share the screenshot of your bean config

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Sherin,

I think payloadSwapBean is not working because there is nothing to swap to You need to use mapping for this.

Regards,

Mark

sherin_jose4
Participant
0 Kudos

Thanks for your reply Mark.

Can you please tell me how i can achieve this when i create the ESR objects.

My requirement is to pass the file as an HTTP attachment.

former_member186851
Active Contributor
0 Kudos

Hello sherin,

Can you please tell me how i can achieve this when i create the ESR objects.

Just create structures and do message and operation mapping