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
  • 1.  Extract form data sent to webmethods

    Posted Tue April 02, 2024 12:05 PM

    My User is sending form data consisting of different content types like application/json , application/Text,image/jpeg

    Is there any way I can extract the content type only just I need (without splitting whole payload using boundary)

    Like below
    ----------------------------643047742134196705328818
    Content-Disposition: form-data; name=“Json details”
    Content-Type: application/json

    {
    “glossary”: {
    “title”: “example glossary”,
    “GlossDiv”: {
    “title”: “S”,
    “GlossList”: {
    “GlossEntry”: {
    “ID”: “SGML”,
    “SortAs”: “SGML”,
    “GlossTerm”: “Standard Generalized Markup Language”,
    “Acronym”: “SGML”,
    “Abbrev”: “ISO 8879:1986”,
    “GlossDef”: {
    “para”: “A meta-markup language, used to create markup languages such as DocBook.”,
    “GlossSeeAlso”: [“GML”, “XML”]
    },
    “GlossSee”: “markup”
    }
    }
    }
    }
    }
    ----------------------------643047742134196705328818
    Content-Disposition: form-data; name=“FirstName”
    Content-Type: application/Text

    webMethods
    ----------------------------643047742134196705328818–


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Extract form data sent to webmethods

    Posted Tue April 02, 2024 09:45 PM

    @Sandeep_Deepala Use pub.flow:getTransport built-in service. This output structure is pub.flow:transportInfo. Field named “requestHdrs” captures all http headers in key value pair. You don’t need to operate on the payload.

    Regards
    Senthil


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Extract form data sent to webmethods

    Posted Wed April 03, 2024 09:16 AM

    @Senthilkumar_G …In this case user is trying to send as form-Data, no core data is sent under requestHdrs.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Extract form data sent to webmethods

    Posted Wed April 03, 2024 10:31 AM

    No. Not reliably. The entire purpose of multi-part form is to be able to correctly parse the content.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Extract form data sent to webmethods

    Posted Wed April 03, 2024 11:21 AM

    so only option is to split payload based upon boundary “----------------------------643047742134196705328818” ?


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Extract form data sent to webmethods

    Posted Wed April 03, 2024 12:05 PM

    Use the MIME services. Do not do this with your own custom code – no need. The boundary string can (will) change for each call.


    #webMethods
    #Integration-Server-and-ESB