Threaded invoke how to validate service to be invoked

I’m working on a java service that uses
doThreadInvoke( svc, IData input).

I want to add error handling to ensure that the requested service exists before I attempt to invoke it.

The NSName class does not seem to be documented in the API docs. Does anyone have ideas on how to tell if an NSName (folder:serviceName) is valid? Is there a way to look it up in the service registry?


Try this:

NSName nsname = NSName.create(folderName, serviceName); 
Namespace namesp = Namepace.current(); 
  // service exists


Thanks! Makes sense. I’ll give it a shot.

Where did you find the docs on nodeExists()?


Follow up.

This worked great, but I did have to import rather than com.wm.lang.ns.Namespace to get access to the current() method.


Two years went by, and I forgot I had this solution (thanks to Rob). The attached java fragment works on IS 6.1


Code fragment for isValidService java service (1.3 k)