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

How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

  • 1.  How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Sat October 22, 2016 05:58 AM

    Hi , I try to get the value of flow service’s service type by Java service, but i get the null value in result panel.
    I use the method in wm.server.services:serviceInfo of WmRoot in Intergration Server.It 's can get the param svc_type of IS webpage,
    but in my java service, the value of svc_type is showed null.
    Can you help me to resolve this issue?
    My java service code as below:

    
    IDataCursor idatacursor = pipeline.getCursor();  
    String serviceName = IDataUtil.getString(idatacursor, "serviceName");  
    IData idata1 = IDataFactory.create();  
    IDataCursor idatacursor1 = idata1.getCursor();  
    IDataUtil.put(idatacursor1, "service", serviceName);
    String serviceType = "";
    String fullname="";
    try  
    {  
    IData idata2 = Service.doInvoke("wm.server.services", "serviceInfo", idata1);  
    IDataCursor idatacursor2 = idata2.getCursor();
    fullname= IDataUtil.getString(idatacursor2, "fullname");
    IData idata3 = IDataUtil.getIData(idatacursor2, "type");
    IDataCursor idatacursor3 = idata3.getCursor();
    serviceType=IDataUtil.getString(idatacursor3, "svc_type");
    idatacursor2.destroy();  
    }  
    catch(Exception exception) {
    exception.printStackTrace();
    }
    idatacursor1.destroy();
    IDataUtil.put(idatacursor, "fullname", fullname); 
    IDataUtil.put(idatacursor, "serviceType", serviceType); 
    idatacursor.destroy();

    Thanks a lot! :smiley: :smiley:
    20161022154633.png


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


  • 2.  RE: How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Sat October 22, 2016 08:09 AM

    What is your wM version?

    You have use the class com.wm.lang.ns.NSServiceType; inorder to get the service type of any service.

    Create a wrapper flow service around wm.server.services:serviceInfo and use the output directly.


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


  • 3.  RE: How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Mon October 24, 2016 07:03 AM

    Additional information:

    Rememeber to destroy ALL pipelinecursors at the proper level.

    idatacursor3 is not destroyed in your code sample.
    It should be destroyed inside the try-block.

    Regards,
    Holger


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


  • 4.  RE: How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Tue October 25, 2016 11:06 PM

    I had destroyed this idatacursor3


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


  • 5.  RE: How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Tue October 25, 2016 11:10 PM

    My wM version is about 9.0 , i do’nt understant how to use the class com.wm.lang.ns.NSServiceType,In my code, The output fullname can show the right value, but svc_type is not show any value, i confuse this issue.


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


  • 6.  RE: How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

    Posted Wed October 26, 2016 03:14 PM

    For your usecase you can get it done by a simple flow service which inovkes “wm.server.services:serviceInfo”

    Could you run the service “wm.server.services:serviceInfo” from designer and capture the output results and post it here. Make sure you are able to access the WmRoot package in your designer if not you must add the below property to your IS extended settings

    watt.server.ns.hideWmRoot=false


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