Retreive and Send input as Multipart/formdata with webMethods

What product/components do you use and which version/fix level?

Integration Server 10.11

Are you using a free trial or a product with a customer license?

customer license

What are trying to achieve? Please describe in detail.

Hello, does anyone know how to retrieve input and send input with content-type multipart/formdata?

when i try to retrieve information, i tried to send the request from postman and restorePipeline but i dont receive any pipeline variable that inputted on the postman.

on the $httpRequest it showed that content-length is very big, but i dont have any content on the pipeline, any idea how to get it as a pipeline variable?

below are the cURL example of the request:

curl --location --request POST 'http://localhost:5555/restv2/BSINosInterface.ws:nosGadaiEmas/submitReservasiGadaiPickup' \
--header 'Authorization: Basic QWRtaW5pc3RyYXRvcjptYW5hZ2U=' \
--form 'KodeReservasi="RG7E49082E4W66"' \
--form 'typeLayanan="Pickup"' \
--form 'kodeCabang="ID0010002"' 

also for the second question, how you send the request to the backend with multipart/formdata with pub.client:http?
Thank you

daily bump, i still haven’t found anyway to parse the message, but i found another thread that use pub.mime built in function, have anyone used this?

Hi, firstly you are missing the encoding type in the content type i.e. “multipart/form-data”

You should then expect the following input into your service

contentStream

then;

pub.flow:getTransportInfo
pub.mime:mergeHeaderAndBody

Input to pub.mime:mergeHeaderAndBody:
headerLine (it’s from transport/http/requestHdrs)
body/stream (contentStream from the begging in the pipeline)

This was documented here

type or paste code hereCannot extract multipart MIME data sent through REST

1 Like

Also there is one sample attached here - How to capture file upload Content from dsp page - Forum - webMethods - Software AG Tech Community & Forums

1 Like

Ha, Ha, that’s one of my own, but I didn’t want to blow my own trumpet :kissing_heart:
John.

2 Likes

Thank you @John_Carter4 and @srikanth.prathipati1803 for responding, i will try the solution that u posted, and i will try to update the progress, thank you so much for helping me, i’m very unfamiliar with this pub.mime API

Hi @mcser76 ,
The built-in services reference talks in detail about the pub.mime services , that should help you. It is available at Built in services - pub.mime

In fact ,the mime area can be complex at times, perhaps that’s why it gets its own guide too - MIME SMIME Developers guide

Good luck

-NP

Thank You @John_Carter4 , @Nagendra_Prasad and @srikanth.prathipati1803 your solution both are right, now i’m able to retrieve and send request to the backend with contentType multipart/form-data using pub.mime built-in function

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