webMethods : Trying to send a file using an pub.client:http post request

Hello fellow developpers, I know several posts are supposed to cover this matter, I’ve read them all a few times, but none of them are recalling my problem.

What I’m trying to do is just receiving a file (multipart/from-data) from an API I’m exposing, and directly send the file back to another API without doing anything to the file.

The first part works well, I’m able to get the ‘contentStream’ variable containing the form-data, here is what I’m getting, copied in a file (the black square is just to censore some data) :
image

The issue comes when I want to send the data, it appears the receiving API doesn’t receive anything after the boundary in the http request. I’ve tried to create an API of my own to send it and check the result but same, can’t get anything out of it

I’ve tried everything I could find here (and more) but I couldn’t make it work

Does any one of you have an idea here?

It’s on webMethods 10.15 by the way.

Thanks!

Try with these steps , You can try to use dummy target API from this site: https://webhook.site/

image

If the data is just passing through and the wM IS doesn’t need to do anything to the data, then perhaps this will work:

  • Pass the contentStream that is received in the call to the HTTP call made to the target.
  • You’ll need to copy HTTP headers too. Not all of them but the headers important for MIME handling. The Content-Type header contains the boundary marker needed to parse the multipart body. The MIME-Version header is important too.

The steps @Sandeep_Deepala shared should work but the above may work for you as well.

1 Like

Similar thread Retreive and Send input as Multipart/formdata with webMethods - #5 by John_Carter4

Yes, that thread reflects what @Sandeep_Deepala shared and is useful if the IS components need to parse or do something specific with the form content. But if the form or parts do not need to be manipulated and only passed on to another system, then the steps can be simplified, not needing the MIME services.

1 Like

Thank you so much, I really though I already tried this one, but I must have done something wrong the first time, sorry for the time loss!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.