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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  How to set pub.client:http parameters when it is a file

    Posted 07/03/23 05:40 AM

    Hi Expert,
    I am trying to send something to others.
    The script is working fine when i run it directly on my server unix box :
    curl -F data_1=A -F data_2=B -F data_3=@D:test\t1.json http://server/url

    However, when i use pub.client:http, i am getting the error data_3 parameter empty.
    It seems that data_3 should be a file, how do I set the data_3 parameter of pub.client:http to make it work? Or is there another way?

    We use webMethods 912.

    Looking forward to your reply.Thanks.
    1


    #B2B-Integration
    #webMethods


  • 2.  RE: How to set pub.client:http parameters when it is a file

    Posted 07/03/23 01:51 PM

    Please check this document and this post and let us know if you need any more information besides them.


    #webMethods
    #B2B-Integration


  • 3.  RE: How to set pub.client:http parameters when it is a file

    Posted 07/03/23 03:21 PM

    Hi Jenny,
    It appears you may not be fully understanding what that curl command is doing. It is not the case that data_3 should be a file. Indeed, given the extension it is probable that data_3 should be a json string. When a curl command sees @D:test\t1.json it replaces that with the content of the local file at D:test\t1.json before sending it to http://server/url

    If you want to do the same, you can use pub.file:getFile with loadAs set to “string” to read the json string from the file sitting on the integration server (see this), then map the content in body/string to data_3.


    #webMethods
    #B2B-Integration


  • 4.  RE: How to set pub.client:http parameters when it is a file

    Posted 07/03/23 09:57 PM

    Hi Expert,
    I did this at first, but I got this error data_3 parameter empty, so I thought the data_3 parameter had to be passed into a file. Yes,I don’t know much about curl command.
    Or what else could I do?

    url:http://server/url
    method:post
    loadAs:bytes
    headers/Content-Type: application/json、text/html、text/plain (I’ve tried all three Settings)

    2


    #B2B-Integration
    #webMethods