webMethods

webMethods

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.  Implementing Restful service using WM Integration Server.

    Posted Mon October 12, 2015 04:51 PM

    I’m trying to expose a simple Restful service using WM Integration server, but I couldn’t find any samples or document apart from Restful service developer guide. Appreciate your guidance.

    As per the document, I have created a folder ‘Program’ and trying to expose it’s resources through the Restful methods. Attaching the screen shot for your ref. What should do next? how do I expose these services for client? do I need to use web-service descriptors ? how to integrate the authentication?

    Please advise.


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Implementing Restful service using WM Integration Server.

    Posted Mon October 12, 2015 05:27 PM

    Dinesh – Java & WebMethods: REST Services in Webmethod url has good explanation. You can go through it.

    Thanks,


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Implementing Restful service using WM Integration Server.

    Posted Tue October 13, 2015 03:29 PM

    Thanks. But, I’m sorry!, I 'm not even able to follow the first step.
    “convert the xml node to document”

    • Which XML?

    Per developer guide, the Restful API is passing only the resourceId.

    Appreciate your guidance.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Implementing Restful service using WM Integration Server.

    Posted Fri October 16, 2015 05:46 PM

    That link seems to imply that the consumer is posting an XML document to the service, which as Dinesh has already discovered, is not always the case.

    One of the better ways for you to get familiar with how it works is to run some data through it. My favorite option is to use something like soapUI in conjunction with services like savePipeline/restorePipeline.

    You can create a REST project in soapUI and provide it your endpoint URL, which in this case, it will be something like: http://localhost:5555/rest/DigitalRestServices.Program

    Please note a couple of important things:

    1. The use of the REST directive instead of INVOKE
    2. The exclusion of the service name from the URL

    From soapUI, play around with changing the HTTP method from GET to POST to whatever and notice different services being called. Also, play around with passing data to the service and changing the content-type around, such as text/xml, application/json, etc, etc.

    Percio


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Implementing Restful service using WM Integration Server.

    Posted Sun October 18, 2015 05:19 PM

    I agree percio with your comments :lol:

    Dinesh, try the options and let us know if you come across any issues.

    Thanks,


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Implementing Restful service using WM Integration Server.

    Posted Mon October 19, 2015 06:20 PM

    Percy Castro,
    Thanks. I’m able to validate the _get method using your guidance.
    However, the response is in HTML format and expectation is to get it in JSON format. Please advise if I need to do any specific configuration while creating the _get service.

    Thanks in advance.
    Dinesh



    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Implementing Restful service using WM Integration Server.

    Posted Tue October 20, 2015 12:14 PM

    In soapUI, add a header with name “Accept” and value “application/json”


    #Integration-Server-and-ESB
    #webMethods


  • 8.  RE: Implementing Restful service using WM Integration Server.

    Posted Wed October 21, 2015 12:23 PM

    Percio,
    It helped. Thanks.


    #webMethods
    #Integration-Server-and-ESB