cancel
Showing results for 
Search instead for 
Did you mean: 

Multipart message via HTTP ?

Former Member
0 Kudos

Has anyone successfully sent a multipart message via the HTTP receiver adapter ? I need to send such message to a marketplace product which requires that. It provides an HTTPS server.

Unfortunately this server expects the data in a format like when posting it from a browser form. The server only accepts it when the form has an input of type file. The result http body needs to contain something like this:

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

--AaB03x

Content-Disposition: form-data; name="submit-name"

Larry

--AaB03x

Content-Disposition: form-data; name="files"; filename="file1.txt"

Content-Type: text/plain

... contents of file1.txt ...

AaB03x

The XI Help speaks about "Enhancing the Payload", but it is not clear to me how we can code a multipart message with the prolog / epilog parameter. Is it doable with configuration ? If not, where in XI do I have full control over the HTTP body which is to be sent ?

CSY

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

You have to do this with a Java mapping, like in this blog:

Just do not create the mail package tags.

Regards

Stefan

Answers (2)

Answers (2)

Former Member
0 Kudos

I solved the problem on my own in the meantime. Here are the results:

- using the prolog/epilog configuration in the HTTP receiver does not work. It does not treat CR/LF correctly and does not give you enough functionality to create the HTTP body exactly as you like it

- I then thought about doing an ABAP or Java mapping, but then had the idea that XSLT-Mapping must be able to do the same thing (generate an arbitrary result document, non-XML).

And this worked, after some pain with XSLT-internals. You build a constant multipart prolog, then include the XML-payload and then add the constant multipart epilog.

When testing the XSL in the designer, it will give an error about malformed result, but this doesnt matter. You can nevertheless process the result in XI correctly. If you set the output type to html in the xsl, you can even display it correctly in the message monitor payload.

In the receiver HTTP channel, you define the content type e.g. like that:

multipart/form-data; boundary=----


7d831a217068c

CSY

Former Member
0 Kudos

Hi Christian

I am working similar kind of scenario. can you provide me the details to req

Former Member
0 Kudos

Hi Christian

I am working similar kind of scenario. can you provide me the details with XSL code?

naruuu

Former Member
0 Kudos