IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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

How to extract multipart request data sent from API Gateway in flow service?

  • 1.  How to extract multipart request data sent from API Gateway in flow service?

    Posted Mon January 02, 2023 08:42 AM

    Hi Everyone,

    I am trying to send a multipart/form-data request to flow service but not able to extract the data in flow service. When I create a REST resource and use my flow in it then it works fine but when I try to use my IS service in routing policy in API gateway then my payload is not getting extracted and give error for missing body parameter at pub.mime:mergeHeaderAndBody.

    Any help would be appreciated.


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


  • 2.  RE: How to extract multipart request data sent from API Gateway in flow service?

    Posted Fri January 06, 2023 01:18 AM

    Hello Usman,

    Could you please provide some more details on the problem.

    How is the multipart request invoking Flowservices. Is it receiving a http request. Also, how are you extracting the multipart data in flow service. Some more details on that would be helpful.

    Regards,
    Sumit


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


  • 3.  RE: How to extract multipart request data sent from API Gateway in flow service?

    Posted Fri January 06, 2023 01:35 AM

    Hi Sumit,

    Thankyou for your response.

    I was able to fix it after trying different approaches.
    This is how i extracted the payload:

    -First I changed my input/out to use RequestSpecs.
    -Then in case of multipart payload comes as bytes in payloadObject of RequestSpecs instead of
    payload String.
    -Then i parsed the bytes to stream as required to create mime data by using build in service
    bytesToStream.


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


  • 4.  RE: How to extract multipart request data sent from API Gateway in flow service?

    Posted Fri January 06, 2023 01:43 AM

    I would suggest you to use OpenAPI consumer support in Integration Server to consumer multipart requests. It provides seamless support for multipart data without the need of user build the mime data from payload. Mime data is automatically parsed and add to pipeline.

    Regards,
    Sumit


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