IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
 View Only
Expand all | Collapse all

How to send data in request body of POST HTTP method

  • 1.  How to send data in request body of POST HTTP method

    Posted Tue April 17, 2018 08:42 AM

    Originally posted by: tverma


    I am working on POC for consuming rest service through ITXA. I am able to consume GET HTTP method rest service by creating type trees and map through OpenAPIImporter.

    However, while consuming POST HTTP method rest service , I require to send json/xml data.

    Can anyone please advise how to send json/xml data in request body to server.

    I am executing below command from output card:
    =VALID( GET( "HTTP" , "-URL http://10.166.120.76:8085/RestExampleTest/rest/json/post -METHOD POST -TV -HDR+ -TYPE application/json -STATUSLINE", PACKAGE(httpRequest)), LASTERRORMSG() )

    Any help would be appreciated!

     

     


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: How to send data in request body of POST HTTP method

    Posted Thu April 19, 2018 07:47 AM

    Originally posted by: tverma


    Can anyone please help with this. It would be great help!


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: How to send data in request body of POST HTTP method

    Posted Fri April 20, 2018 07:25 AM

    Originally posted by: PaulBrett


    What error messages do you get back from the server?

    What does the HTTP adapter trace show?

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: How to send data in request body of POST HTTP method

    Posted Fri April 20, 2018 08:37 AM
      |   view attached

    Originally posted by: tverma


    Thanks Paul for the response!

    We are getting 500 Internal Server Error because we are unable to send data in request body by using HTTP POST method. Also, please find attached log.

    We have followed below blog link to consume rest service, GET HTTP method is working fine, but in POST HTTP method we not able to send data in request that server is requiring to process request.

    https://www.imwuc.org/blog/using-itx9.0.0.1-with-open-api

    Request you to please help us out how to send json data in request body of HTTP POST method.

     

     


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)

    log
    Error.log   94 KB 1 version


  • 5.  Re: How to send data in request body of POST HTTP method

    Posted Tue April 24, 2018 07:01 AM

    Originally posted by: tverma


    Not getting solution using POST HTTP method.

    Can anyone please help with this or please provide alternative solution. It would be great help!


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: How to send data in request body of POST HTTP method

    Posted Wed April 25, 2018 05:25 AM
      |   view attached

    Originally posted by: PaulBrett


    Consider the example at http://editor.swagger.io/

    I used the menus on this page to download the JSON.  I imported this JSON using the OpenAPI importer, to create the map attached.  When executed, it inserts a pet "Killer" with a status of "available" into the data store.  Use the swagger-getPetByIdHttpCommand.url shortcut to confirm the existence of the pet before and after the map is executed.

    Use the examples on the webpage to delete the pet when done.  (Or import the JSON to create another example to delete the pet).

    I recommend you change the '48197' ID with one of your own to avoid confusion with other users of this publicly available system.

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)

    zip
    JSON.zip   15 KB 1 version


  • 7.  Re: How to send data in request body of POST HTTP method

    Posted Wed April 25, 2018 05:38 AM

    Originally posted by: Juanpedobits


    check the requests well. check the logs file on your server they are usually in this directory

     

    /usr/local/apache/domlogs/youdomain.com


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 8.  Re: How to send data in request body of POST HTTP method

    Posted Wed April 25, 2018 05:51 AM
      |   view attached

    Originally posted by: PaulBrett


    A further development of the example, including a 'deletePet' map.

    Thank you.

    Paul

    Follow me on Twitter


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender

    Attachment(s)

    zip
    JSON2.zip   22 KB 1 version


  • 9.  Re: How to send data in request body of POST HTTP method

    Posted Wed April 25, 2018 10:24 AM

    Originally posted by: iWork321


    Hi Paul

     

    We are on WTX 9.0.0.0 and thus don't have OpenAPI. I tried to copy/paste the JSON request object into a JSON flat file and imported to create a type tree in WTX. However not sure how I would build the output card and send in a parameter to invoke the RESTful webservice. Could you please help?


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 10.  Re: How to send data in request body of POST HTTP method

    Posted Mon April 30, 2018 08:42 AM

    Originally posted by: tverma


    Thanks a lot Paul for your response!

    It worked for me.


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 11.  Re: How to send data in request body of POST HTTP method

    Posted Mon April 30, 2018 12:46 PM

    Originally posted by: iWork321


    Can somebody please post me the link to the HTTP adapter that documents all the options available within the GET() function like -METHOD, -TV, -HDR etc...and what they do???

     

    Thanks


    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 12.  Re: How to send data in request body of POST HTTP method