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.  Invoking REST from ARC

    Posted Thu March 17, 2016 08:37 AM

    Hi All,

    I have created a _post REST webservice and trying to test it from Chrome ARC.
    I tried to pass following URL with the JSON message but getting below error:
    URL:
    http://localhost:5555/[b]rest[/b]/Webservices.REST.OrderConfirmation_Rest:_post

    Error:
    Access denied for user Administrator on port 5555 → ‘rest/Webservices.REST.OrderConfirmation_Rest:_post’ from 0:0:0:0:0:0:0:1.

    However, when i tried to invoke the URL using invoke, it worked fine.
    http://localhost:5555/[b]invoke[/b]/Webservices.REST.OrderConfirmation_Rest:_post

    I have even set the Execute ACL to Anonymous in this _post service.
    Just wondering what config I am missing for using rest.
    Any help would be much appreciated.

    Thanks,
    Amit


    #soa
    #API-Management
    #webMethods


  • 2.  RE: Invoking REST from ARC

    Posted Fri March 18, 2016 02:51 AM

    Figured out the issue myself.

    In case of Invoke, the path of service separated by “.” but in case of using REST it is separated by “/”.

    Invoke Call:
    http://localhost:5555/invoke/Webservices.REST.OrderConfirmation_Rest:_post

    Rest Call:
    http://localhost:5555/rest/Webservices/REST/OrderConfirmation_Rest/_post


    #API-Management
    #webMethods
    #soa


  • 3.  RE: Invoking REST from ARC

    Posted Fri March 18, 2016 03:20 AM

    Hi Amit,

    Yes. The directive to be used for REST services is “rest”.


    #webMethods
    #API-Management
    #soa


  • 4.  RE: Invoking REST from ARC

    Posted Sat March 19, 2016 05:19 PM

    Not always, by default it is rest and if you want to change the name of the REST directive you have to mention the setting in IS extended settings

    watt.server.RESTDirective=


    #soa
    #API-Management
    #webMethods


  • 5.  RE: Invoking REST from ARC

    Posted Sat March 19, 2016 06:17 PM

    Everything works as expected. If you want to call the service as REST, send a POST request and specify “http://localhost:5555/[b]rest[/b]/Webservices.REST.OrderConfirmation_Rest” as the URL. IS will call the “…:_post” service automatically (because you issue a POST request). If you send a GET request, IS will call the “…:_get” service.

    However, if you call the service via “invoke”, you have – as usual – to specify its full name, i.e. “…:_post”


    #webMethods
    #API-Management
    #soa


  • 6.  RE: Invoking REST from ARC

    Posted Sun March 20, 2016 03:58 AM

    Hi Amit,

    Calling the restful service with URL containing “.” is generally discouraged.

    Your URL must contain “/” not “.” For the permission error, you can change the flow service permission as " Anonymous" in order to invoke the service.

    Regards,
    Jacob B


    #soa
    #webMethods
    #API-Management


  • 7.  RE: Invoking REST from ARC

    Posted Sun March 20, 2016 04:01 AM

    Change the permission of the flow service to anonymous and call the service like below.

    POST http://localhost:5555/rest/(resource path separated by /)

    Regards,
    Jacob B


    #soa
    #webMethods
    #API-Management


  • 8.  RE: Invoking REST from ARC

    Posted Sun March 20, 2016 12:11 PM