Skip to Content
Technical Articles

REST Adapter FROM data with Attachment Handling

SAP PI REST adapter can achieved FORM data upload scenarios from HTTP client Application or standard HTML pages.

The target application has Functionality to upload zip file along with FROM data request parameters, making use of this service source system such as ECC or any legacy application post data using integration layer SAP PI.

Once you uploaded file and FROM Data from ECC or legacy application that request reached to PI from there we need post Form data parameters along with attachments and we need get response as success or failures.

Here I had exposed Sender as REST adapter as Binary data handling with-out using Java mapping, initially I had tried in many ways by HTTP_AAE  FORM data options and handle using java mapping suggested by blog – (https://blogs.sap.com/2014/09/12/html-form-upload-using-http-plain-adapter-with-java-mapping/) and as format expected by Target Application but it’s getting 400 BAD request from target system.

Finally I have started implementing REST Adapter as Sender Adapter and Receiver used as SOAP adapter. Now I can able to get success Response.

Sender REST Adapter Configurations:

Under Channel section Specify Endpoint that you required.

RestResources mentions as pattern “/”

 

The other Tabs selection make it as default, no changes required.

Receiver SOAP Adapter configuration:

Please provided your end-point URL and enable options such as – Do Not Use SOAP Envelope , Keep Attachments .

Here in my-case I have proxy tunnel in network so I enabled Configure Proxy, Most have customer not enabled so you need not enable and configure it.

Results:

Post man client I have provided SAP PI URL along with FORM Data parameters and Attachments.

 

Here we can achieve by using REST/SOAP adapter, I have used SOAP adapter.

The process when you trigger message from PROXY of HTTP application will convert binary format  in standard  send REST adapter acceptable by Target service binary format.then we can get success response  from service.

I hope this blog was helpful to understand how the FORM data and attachments  can be used in REST/ SOAP adapter . If you like to learn more, check out the other blogs in the series, accessible from the main blog PI REST Adapter – Blog Overview.

Still not found what you were looking for?

No problem! Just let us know what kind of information is missing and how we can help.

7 Comments
You must be Logged on to comment or reply to a post.
  • Hi Ganesh,

    How are you setting the Input message format as ‘Binary’.

    I don’t see such option in drop down list of General Tab -Sender REST Communication Channel).

  • Hello Rajesh,

    Thanks for your comments..The reference blog as mentioned in UDF the same i have implemented UDF as similar alignment to FORM Data but when we are reading attachment the conversation not allowed by Target service.i have tried by add attachment option also but not luck. Even i have tried bind attachment in UDF mapping.

    also i have tried by different REST API Java stand-alone java program to able to achieve service. but no luck.

    its works when enabling Binary option only.

    Thanks

    Ganesh Gullipalli.

    • Hi Ganesh,

       

      Good that it worked by setting the Input message format as ‘Binary’ in REST channel.

      Let me also kindly check out the PI latest package. Thank you!

  • Hi Rajesh,

     

    Source will send data to key-values attributes similar to  HTML page FORM submit action along with attachment.

    Binary option has added on SAP PO 7.5 latest SP. Please verify once SP9 later versions.

     

    Thanks ,

    Ganesh G

  • Hi Ganesh and team

     

    I have a similar requirement Rest to SOAP scenario, where I need to handle Invoice (Json payload) along with PDF attachments.

    I have followed above blog.

    When you tested from Postman tool, what does the zip file contain ?

    can you please share sample payload of it and how you see the request in PO Monitoring. I am struggling to test from Postman tool

    I am working on SAP PO 7.5 SP 16

     

    Thanks,

    Varun