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.  How to consume REST service (frtom Get method)

    Posted Wed November 30, 2016 09:33 AM

    Hi,

    I know it is a classic subject, but I did not found any example over the net :

    I have a service flow which consumes an external REST service (resource A), and I’m calling it with the POST method. I’ve used the http service, and configured it (url, method, data, auth…) flow, and then all works fine.

    Now, I have a new resource B from the same REST service but this one works with a GET method.
    How the data has to be transmit in the URL please ?

    I’ve tried many ways :

    • to send a string data to the http\data\string
    • to send a string data to the http\data\arg
    • to send the a string and converting it with Json

    but nothing seems to work, I’m sure I’m missing a little details…

    I’ve looked into all the 9.8 documentations without finding any example. So if you could give me the name of the documentation, I would appreciate that too 8)

    Regards


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


  • 2.  RE: How to consume REST service (frtom Get method)

    Posted Thu December 01, 2016 03:02 AM

    HI,

    Below is a sample which worked for me.

    Hope you are able to hit the GET request on browser and getting response.

    Say the URL looks like
    http://localhost:5555/rest/CacheChannel/REST/new_rest?TEST=1234

    I used pub.client.http with below inputs.

    For url input supply the url without parameters as below
    http://localhost:5555/rest/CacheChannel/REST/new_rest

    method :: set this as GET

    data/string :: supply the parameters as below
    ?TEST=232323

    This will return you bytes in response, you can convert this to string using bytesToSting. Here the response will be in XML.

    Thanks
    Abdul Bari Khan


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


  • 3.  RE: How to consume REST service (frtom Get method)

    Posted Thu December 01, 2016 04:26 AM

    Thanks for your reply Barry, unfortunaltely, I have already tried this but the HTTPS URL below is difficult to the test (needs authorization) :
    https://espaceclient.sepalia.fr/rcte/bpi/ibantobic?iban=1000

    but the REST web service returns header/statusMessage = NOT FOUND

    Here is in ATTACHED file, the test I’ve made in SoapUI with a test IBAN value. Like you can see, when the REST service succeeds, it returns a BIC value.

    In SoapUI, if I test a standard GET call : “URL?iban=value”, the reply returned is the same as in webMethods : NOT FOUND
    but if you watch into SoapUI param, you can see that the param must be a TEMPLATE/RESOURCE with the {iban} param.

    Maybe it is not a standard GET to do with the Designer ?

    Regards


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


  • 4.  RE: How to consume REST service (frtom Get method)

    Posted Thu December 01, 2016 04:30 AM

    When I do some POST calls (for other operations), I set “Headers\Content-type = application/xml” for it to work.

    For GET, do you leave it empty ?


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


  • 5.  RE: How to consume REST service (frtom Get method)

    Posted Sun December 04, 2016 02:25 AM

    Can you confirm if the GET method is implemented on the target.

    Tried dropping the GET implementation in my local and i am getting the same response.


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


  • 6.  RE: How to consume REST service (frtom Get method)

    Posted Sun December 04, 2016 10:11 AM

    Hi,

    I’ve tried that call and it is ok :
    https://espaceclient.sepalia.fr/rcte/bpi/ibantobic/FR11

    I had just to concate variable path with the prefix URL.

    Thanks for your help
    Regards


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