POST endpoint to accept Zip file

Hi community,

I have to develop a POST endpoint in webMethods IS to receive zip files.

From what I see I can’t use the builtin REST Functionality for this purpose. So far I have build a custom service, use pub.flow:getTransportInfo to get the protocol type and the http verb. I notice that if I put a contentStream object as an input of the service then this gets automatically populated with the content of the http request. I am now struggling in extracting the zip file and save it to disk… Any idea or better suggestion to handle this ?

header of the http request:

and value of the contentStream converted to string

Thanks
Alex

Hi Alexandre,

you should make sure that the zip file is base64 encoded for the transport.
Otherwise the invocation might be truncated before completion.

You can than decode it in your service.

Regards,
Holger

1 Like

Hi Holger,

Thanks for your reply, it is not clear to me yet if the content will be base64 encoded. Would you access the content using the contentStream ? how would you parse it and create the zip file out ?

If the zip is base64 encoded the content type should be text/plain, then I can get the stream variable would be named ‘ffdata’ and then I can decode it…

Is there any documentation about the contentHandlers and how it transform the incoming request depending on the Content-Type ?

Thanks