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

Upload a file using pub.client.http

  • 1.  Upload a file using pub.client.http

    Posted Mon August 29, 2022 05:22 AM

    I have gone through a lot of posts on how to upload a file using post method of pub.client.http but still not able to get success. Below is my requirement from postman. I am uploading a dummy file by passing these two key value in Body in postman

    I have uploaded the steps I tried to upload the file. I am getting http 200 but error from API response. I am using webMethods 9.10. I cannot use java service as per client’s requirement. Appreciate your help in this.

    Screenshots.zip (273.0 KB)


    #webMethods-io-Integration
    #webMethods-cloud
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Upload a file using pub.client.http

    Posted Mon August 29, 2022 06:20 AM

    Hi Akshay,

    can you share the error message from the API response for further inverstigations, please?

    Regards,
    Holger


    #webMethods
    #webMethods-io-Integration
    #webMethods-cloud
    #Integration-Server-and-ESB


  • 3.  RE: Upload a file using pub.client.http

    Posted Tue August 30, 2022 04:28 PM

    Hi Holger,

    Below is the response from API.

    There was an error executing your request.
    Request made at 2022-08-30 18:36:10 +0000 from

    If I change something in request or try to do it in some other way as mentioned in few similar posts I get a huge response in html form but the error message remains same. I get a json response with some data from postman when the file is successfully uploaded.


    #webMethods-cloud
    #webMethods
    #Integration-Server-and-ESB
    #webMethods-io-Integration


  • 4.  RE: Upload a file using pub.client.http

    Posted Wed August 31, 2022 07:23 AM

    Without looking in any real detail - are you setting the right content-type (multipart/form-data) in the headers on the http service?
    Postman tends to do this automatically for you, so sometimes I’ve seen people forget about this when they try to replicate a call into integration server.


    #webMethods-io-Integration
    #Integration-Server-and-ESB
    #webMethods-cloud
    #webMethods


  • 5.  RE: Upload a file using pub.client.http

    Posted Thu September 15, 2022 11:42 AM

    Hello Akshay,

    From the screen shot, it seems you are trying to send multipart data. To replicate this in IS, you need to build MIME data and then set it as a stream or byte to pub.client:http data variable.

    • Sumit

    #Integration-Server-and-ESB
    #webMethods-io-Integration
    #webMethods-cloud
    #webMethods


  • 6.  RE: Upload a file using pub.client.http

    Posted Tue September 27, 2022 06:04 AM

    i always fail to send files with mime

    Thanks & Regards
    Maman H


    #webMethods
    #webMethods-io-Integration
    #webMethods-cloud
    #Integration-Server-and-ESB


  • 7.  RE: Upload a file using pub.client.http

    Posted Tue September 27, 2022 08:18 AM


  • 8.  RE: Upload a file using pub.client.http



  • 9.  RE: Upload a file using pub.client.http

    Posted Wed September 28, 2022 06:48 AM

    Hi @akshay.hans hope this thread help you Pub.client:http with mutiform-data, i have the same problem as you before, i’m trying to producing the postman form-data request from Integration Server, those above thread solved my case though, hope it helps


    #Integration-Server-and-ESB
    #webMethods-cloud
    #webMethods
    #webMethods-io-Integration