webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Retreive and Send input as Multipart/formdata with webMethods

  • 1.  Retreive and Send input as Multipart/formdata with webMethods

    Posted Sat July 16, 2022 06:24 AM

    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


    #Integration-Server-and-ESB
    #webMethods
    #Service-Designer
    #Flow-and-Java-services


  • 2.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Sun July 17, 2022 11:23 AM

    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?


    #Service-Designer
    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Sun July 17, 2022 02:36 PM

    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


    #webMethods
    #Integration-Server-and-ESB
    #Service-Designer
    #Flow-and-Java-services


  • 4.  RE: Retreive and Send input as Multipart/formdata with webMethods



  • 5.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Mon July 18, 2022 02:38 AM

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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #Service-Designer
    #webMethods


  • 6.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Tue July 19, 2022 07:37 AM

    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


    #webMethods
    #Integration-Server-and-ESB
    #Service-Designer
    #Flow-and-Java-services


  • 7.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Tue July 19, 2022 11:09 AM

    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


    #Integration-Server-and-ESB
    #Service-Designer
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Fri July 22, 2022 04:53 AM

    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


    #Service-Designer
    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Sun July 17, 2022 02:22 PM

    We are planning to provide out of the box support for App Dynamics. Here is a package to start with

    https://github.com/johnpcarter/WxAppDynamicsAgent

    I am planning to add support for API Gateway in the next week :wink:

    For info this package is already in production with a customer and so doesn’t suck, but is not user feature complete. Feedback will be very welcome.

    Regards,


    #Service-Designer
    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 10.  RE: Retreive and Send input as Multipart/formdata with webMethods

    Posted Sun July 17, 2022 02:23 PM

    Woops, wrong email chain!

    Sorry,


    #webMethods
    #Service-Designer
    #Flow-and-Java-services
    #Integration-Server-and-ESB