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
  • 1.  String and file in pub.client:http

    Posted Thu March 18, 2021 04:58 AM

    hi guys,
    i need help to put string and file from sftp to pub.client:http like in the picture below, but the service seemed only to read just the string not the file.


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


  • 2.  RE: String and file in pub.client:http

    Posted Thu March 18, 2021 11:37 AM

    The children of data/args are name/value pairs. From the docs:

    To specify data using args , create one String
    element for each name/value pair that you want to
    submit,

    A byte array cannot be passed. If you’re trying to send parameters in the URL, and the file content as the HTTP body, then map the stream of the open file to data/stream. From the docs:

    You can use stream to submit data via the POST,
    PUT, or PATCH methods only.

    Important: When you use stream and another element
    (args , table , string or bytes ) to specify data, the
    service appends the data from the args , table ,
    or string element to url . The service appends
    args to url first, table second, and string last.
    The service encodes the data from the stream
    element in the body of the post.

    Be sure to set the Content-Type to appropriate value, which looks like you may be doing since headers looks to have something defined in your screen shot.

    The names of the vars in data/args seem a bit odd – method and data seems like there may be confusion about setting the right inputs. Can you share the values being set there?

    HTH


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


  • 3.  RE: String and file in pub.client:http



  • 4.  RE: String and file in pub.client:http

    Posted Fri March 19, 2021 01:56 PM

    Thanks for sharing the Postman screen.

    Depending upon what the target you’re calling supports, you can either follow the info shared above (URL parameters, file data as the HTTP body with the appropriate Content-Type header) or you’ll want to review the material for how to send multipart/form-data. Postman is doing some work for you under the covers – you’ll need to replicate that when using pub.client:http.


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