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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
Expand all | Collapse all

find reference of service using code

  • 1.  find reference of service using code

    Posted 06/02/11 06:54 AM

    Hi,
    Is there a way to get the references of a given service using a program/code instead of right clicking on the service and then cliking on ‘Find References’. I checked Integration server java API but did not find any classes which can be used to find the references.

    regards,


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


  • 2.  RE: find reference of service using code

    Posted 06/02/11 01:36 PM

    Napster,

    I don’t know if there is an API, but you can easily do this through a unix/windows script that can scan through the xml files on the file system and inspecting them for the service name within.

    • Hara

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


  • 3.  RE: find reference of service using code

    Posted 06/02/11 03:54 PM

    wm.server.ns.dependency:getReferences

    This is not a public service and not intended for our use so wM won’t help if you encounter trouble.


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


  • 4.  RE: find reference of service using code

    Posted 06/02/11 04:19 PM
    IDataCursor pipelineCursor = pipeline.getCursor();
    String	serviceNSname = IDataUtil.getString( pipelineCursor, "serviceNSname" );
    pipelineCursor.destroy();
    
    NSNode nsNodeObj = Namespace.current().getNode(serviceNSname);	
    
    DependencyManager dm = NSDependencyManager.current();
    IData dependentObj = dm.getDependent(nsNodeObj, null);
    
    IDataUtil.put( pipelineCursor, "dependent",dependentObj);
    pipelineCursor.destroy();

    Input is the NSName of the service. As Rob mentioned these classes are not public, so SAG can change them with out any notice either in a new version or as part of a fix.

    Cheers,
    Akshith


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


  • 5.  RE: find reference of service using code

    Posted 06/03/11 07:35 AM

    :slight_smile:

    Akshith,Reamon thanks it worked!!!

    The code posted by Akshith gives the Dependent services, I just changed a single line in code to get the Referenced services

    Changed
    IData dependentObj = dm.getDependent(nsNodeObj, null);

    to
    IData dependentObj = dm.getReferenced(nsNodeObj, null);

    Any idea where can I get details about this non public API’s?

    regards,


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


  • 6.  RE: find reference of service using code

    Posted 06/03/11 03:07 PM

    If you’re looking for documentation or usage notes, they don’t exist. These things are not intended for our use.

    For discovering services you can browse the WmRoot package. Either in IS Administrator or at the disk level.

    For discovering classes you can review JAR files in a search and discover mode. :slight_smile:


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


  • 7.  RE: find reference of service using code

    Posted 06/03/11 03:55 PM

    For some reason i misunderstood that you needed to find dependents but yes the getReferenced method should return what you need.

    I would suggest start using the Designer as it will show you all the classes/methods that are available from IS. Refer the server API for the imports.

    Cheers,
    Akshith


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


  • 8.  RE: find reference of service using code

    Posted 06/06/11 12:45 PM

    Reamon,Akshith thanks.
    I think using a java decompiler will also be helpful to check the code.


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


  • 9.  RE: find reference of service using code

    Posted 06/06/11 03:28 PM

    Be sure not to violate any license agreements.


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


  • 10.  RE: find reference of service using code

    Posted 06/06/11 04:53 PM

    That is the reason why i did not suggest using a Decompiler :slight_smile:

    I think the best approach would be to use the Designer\Eclipse for exploring these hidden API’s.

    Cheers,
    Akshith


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


  • 11.  RE: find reference of service using code

    Posted 06/06/11 05:14 PM

    Yup! I knew you were avoiding that. My comment was for Napster as we don’t want to be promoting anything that violates wM licensing!


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


  • 12.  RE: find reference of service using code

    Posted 10/04/11 11:02 AM

    Hi,
    To find dependants using above code ,what are the classes to be imported in the shared tab ?


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


  • 13.  RE: find reference of service using code

    Posted 10/05/11 03:03 PM

    com.wm.lang.ns.DependencyManager;
    com.wm.lang.ns.NSNode;
    com.wm.app.b2b.server.ns.NSDependencyManager;
    com.wm.app.b2b.server.ns.Namespace;

    You can use Designer to figure out the imports.

    Cheers,
    Akshith


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


  • 14.  RE: find reference of service using code

    Posted 07/11/12 04:52 PM

    Hi All,

    Please anyone tell me what are classes to be imported for this code. I got following errors while compiling. I am trying this in IS 6.5.

    Thank you for your help

    Regards,
    Mohan


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