Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Java Mapping for HTTP Post


Hi

Im following this blog http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/09/12/html-form-upload-using-http-plain-adapter-with-java-mapping but I have encountered an issue which I cannot solve.

My issue is, in addition to the required output, I am also getting unwanted XML added, which originates from the Message Type in the source Service Interface,

i.e.

Content-Type: multipart/form-data; boundary=--ejjeeffe1

--ejjeeffe1
Content-Disposition: form-data; name="event"
Content-Type: text/plain

Import File
--ejjeeffe1
Content-Disposition: form-data; name="Filename"
Content-Type: text/plain

TestFile.zip
--ejjeeffe1
Content-Disposition: form-data; name="content";filename="TestFile.zip"
Content-Type: application/zip
Content-Transfer-Encoding: binary

<?xml version="1.0" encoding="UTF-8"?><__EmptyDoc></__EmptyDoc>
--ejjeeffe1

Any suggestions much appreciated.

Regards

Steve

Tags:
Former Member
Former Member replied

Hi Stephen

The xml must be getting added in the below part of the code. It is coming from arg[0]

You can put a check and get it removed.

while ((len = arg0.read(buffer)) != -1) {

  arg1.write(buffer, 0, len);

  }

Regards

Osman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question