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
Expand all | Collapse all

Service to check if service exists

  • 1.  Service to check if service exists

    Posted Mon November 21, 2011 12:29 PM

    Hello

    I need to create a service that has a service name string as input and returns true if the service exists. I checked the webMethods API javadoc and was not able to find any usable approach.

    If there is no other solution, I could check on a file system level if the corresponding files exist, but I would prefer to have a clean solution based on webMethods APIs.

    I would really appreciate to know if anyone else needed to solve this one.

    Thanks in advance,
    Raimund


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


  • 2.  RE: Service to check if service exists

    Posted Mon November 21, 2011 11:49 PM

    By “the service” do you mean a flow service, a web service or something else?


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


  • 3.  RE: Service to check if service exists

    Posted Tue November 22, 2011 12:13 AM

    It is doable but not with any publicly-available API. com.wm.lang.ns.NSName may be useful to get you started.


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


  • 4.  RE: Service to check if service exists

    Posted Tue November 22, 2011 11:41 AM

    WmRoot/wm.server.services.serviceInfo (checked it on version 8.2, not sure about the earlier versions)

    Accepts a fully qualified name of the service and return the information about that service…also returns a message “Unknown service …” if it doesn’t find it…

    please make a note …this service is in WmRoot package…SAG discourages the use of services in this package…


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


  • 5.  RE: Service to check if service exists

    Posted Tue November 22, 2011 03:57 PM

    Thanks.

    I have already prototypically implemented the check on file system level - an approach that is not very clean but working.

    Using the WM internal service is an alternative I will evaluate.

    So far, both solutions are a bit off from standard usage but will do its duty.


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


  • 6.  RE: Service to check if service exists

    Posted Tue November 22, 2011 03:59 PM

    BTW: One advantage of the file system based approach is, that you also can apply it to documents, adapters, etc.

    I am reading the node.ndf file and returning the service details (type, …)


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


  • 7.  RE: Service to check if service exists

    Posted Tue November 22, 2011 04:48 PM

    The NSName (and related non-public classes) will work with any namespace element, not just services.


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


  • 8.  RE: Service to check if service exists

    Posted Tue November 22, 2011 05:13 PM

    Ok, I can instantiate a NSName Object using e.g. a service name.
    But besides invoking that service, I did not find any other use for that object using the API.


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


  • 9.  RE: Service to check if service exists

    Posted Tue November 22, 2011 06:18 PM

    Yeah, as I mentioned, there are non-public classes that can be used to query the Namespace. Forum rules prevent me from listing them here.


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


  • 10.  RE: Service to check if service exists

    Posted Wed November 23, 2011 08:01 AM

    Thanks Rob, I do not want to go there anyway. The file system approach is not much cleaner but simple and serves it’s purpose.


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


  • 11.  RE: Service to check if service exists

    Posted Wed November 23, 2011 02:14 PM

    Can you please share the solution that you built! might be useful for someone who is in need!


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