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.


#TechXchangePresenter
 View Only
  • 1.  Send input as Multipart/formdata with webMethods

    Posted Mon October 20, 2025 10:12 AM
    Hello,
    I'm currently working on replacing a curl script to make a call directly from the webmethods server integration.
    the actual curl is :
    -location 'https://monsite.fr/api/files/v1/sftp/etl/fichier' --form 'file=@'$fileName
    I first retrieved my file in Bytes with the command "pub.file:getFile" then i use the "pub.client:http" service :
    -url => "https://monsite.fr/api/files/v1/sftp/etl/fichier"
    -method => "POST"
    -loadAs => "bytes"
    -data/bytes => object bytes (my file)
    -headers/content-type => multipart/form-data
    the result is : "{"timestamp":"2025-10-20","status":500,"error":"Internal Server Error","message":"Failed to parse multipart servlet request","path":"/files/v1/sftp/etl/fichier"}
    it is same result if i let the value data/bytes empty, It's the same if i use stream, etc.
    I'd like to know how to transmit my file so that it's properly processed.
    I dont udnerstand how it works and how i am able to do the job.
    Please Help me !


    ------------------------------
    Geoffrey MOULIN
    ------------------------------


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

    Posted Mon October 20, 2025 11:47 AM

    You likely need to use the pub.mime services for posting multipart/form-data.

    There are some older forum posts covering using them with HTTP. E.g.
    https://community.ibm.com/community/user/question/sending-an-xml-file-using-pubclienthttp

    There is a guide for general usage of the services
    https://www.ibm.com/docs/en/webmethods-integration/wm-integration-server/10.15.0?topic=mime-smime-developers-guide




    ------------------------------
    Dave Laycock
    ------------------------------



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

    Posted Tue October 21, 2025 03:05 AM

    Thanks,

    I will read this guide and i think it will help me succeed !



    ------------------------------
    Geoffrey MOULIN
    ------------------------------



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

    Posted Tue October 21, 2025 04:33 AM

    I read this article and looked at what's been done regarding adding a PDF.

    This allowed me to create a service that seems to work creating MIMEData, but I still get an error :

    {"type":"about:blank","title":"Unsupported Media Type","status":415,"detail":"Content-Type 'text/csv' is not supported.","instance":"/files/v1/sftp/etl/fichier"}
    the content type test/csv here is the one used in the service "pub.mime.addBodyPart" :
    I have to set a content type, otherwise the addBodyPart service crashes, and no matter what type I set, I get the same error.



    ------------------------------
    Geoffrey MOULIN
    ------------------------------



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

    Posted Wed October 22, 2025 10:25 AM

    Hi,

    Try to use base64Encode.
    You can find it at pub.string:base64Encode.

    Br,



    ------------------------------
    Giel van Boxtel
    ------------------------------