Problems using Service.doInvoke(); - wM6.1

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

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


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
1 error


Someone can help at this?


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

NSName svcName = NSName.create(“”);

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

cannot resolve symbol
symbol : class NSName
location: class Test_daniel
NSName svcName = NSName.create("

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


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

Seems the JVM can’t find these packages?!

can u post the code ?


Regarding the first error you were getting:
cannot resolve symbol
symbol : method doInvoke (java.lang.String,java.lang.String)
location: class

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

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;

  if (idcPipeline.first("serviceNS"))
    strServiceName = (String) idcPipeline.getValue();
    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);

Hope this helps !