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.  Problems using Service.doInvoke(); - wM6.1

    Posted Wed March 12, 2008 11:22 AM

    Hi everyone,

    i got some problems coding an recursive java service in wM.

    After searching the forum, I found the method Service.doInvoke in package com.wm.app.b2b.server.Service.

    So i imported the package in my service and do a call like:

    Service.doInvoke(“PATH:FLOWSERVICE”, “LISTOFVALUES”);

    If I want to compile my service i got the following error message:

    cannot resolve symbol
    symbol : method doInvoke (java.lang.String,java.lang.String)
    location: class com.wm.app.b2b.server.Service
    Service.doInvoke("PATH:FLOWSERVICE
    ", "LISTOFVALUES");
    ^
    1 error

    :confused:

    Someone can help at this?

    Greets,
    sx1911


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


  • 2.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Wed March 12, 2008 01:18 PM

    On searching the web I found the following to convert the string path of my service to an NSName Object:

    NSName svcName = NSName.create(“Path.to:yourService”);

    But at least, i also get an error… :mad:

    cannot resolve symbol
    symbol : class NSName
    location: class Test_daniel
    NSName svcName = NSName.create("Path.to:yourService
    ");


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


  • 3.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Wed March 12, 2008 02:49 PM

    did u import “com.wm.lang.ns.NSName” into your service .From the error u posted i guess its not recognising the class NSName.

    HTH
    srikanth


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


  • 4.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Wed March 12, 2008 02:52 PM

    The com.wm.lang.ns.NSName and com.wm.app.b2b.server.Service package were imported in the service, yes.

    Seems the JVM can’t find these packages?!


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


  • 5.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Wed March 12, 2008 07:19 PM


  • 6.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Thu March 13, 2008 04:50 PM

    sx1911,

    Regarding the first error you were getting:
    cannot resolve symbol
    symbol : method doInvoke (java.lang.String,java.lang.String)
    location: class com.wm.app.b2b.server.Service
    Service.doInvoke(“PATH:FLOWSERVICE”, “LISTOFVALUES”);

    You got this error because the doInvoke method does not take two strings as input. There are different signatures for the doInvoke service, some of which take an NSName and some of which do not. If you don’t want to create an NSName object before calling doInvoke, then just use this signature of the method:

    doInvoke(java.lang.String ifc, java.lang.String svc, IData input)

    ifc = the path/folder name
    svc = the service name
    input = the pipeline object you want to give to the service

    See the Java API Reference for more details.

    • Percio

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


  • 7.  RE: Problems using Service.doInvoke(); - wM6.1

    Posted Fri March 14, 2008 05:59 AM

    In PSUtilities package there is one service to perform same operation , Please find snippet of the code below -

    [highlight=java] IDataCursor idcPipeline = pipeline.getCursor();
    IData inputData = null;
    IData outputData = null;
    String strServiceName = null;

    try
    {
    if (idcPipeline.first("serviceNS"))
    {
    strServiceName = (String) idcPipeline.getValue();
    }
    else
    {
    throw new ServiceException("missing service name");
    }
    
    if (strServiceName.length() == 0)
    throw new ServiceException("Invalid service name");
    
    if (idcPipeline.first("input"))
    inputData = (IData) idcPipeline.getValue();
    
    NSName nsName = NSName.create(strServiceName);
    
    outputData = Service.doInvoke(nsName, inputData);
    
    if (outputData != null)
    idcPipeline.insertAfter("output", outputData);
    
    }
    catch (Exception e)
    {
    throw new ServiceException(e);
    }
    finally
    {
    idcPipeline.destroy();
    }[/highlight] 
    

    Hope this helps !


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