Service to check if service exists

Hello

I need to create a service that has a service name string as input and returns true if the service exists. I checked the webmethods API javadoc and was not able to find any usable approach.

If there is no other solution, I could check on a file system level if the corresponding files exist, but I would prefer to have a clean solution based on webmethods APIs.

I would really appreciate to know if anyone else needed to solve this one.

Thanks in advance,
Raimund

By “the service” do you mean a flow service, a web service or something else?

It is doable but not with any publicly-available API. com.wm.lang.ns.NSName may be useful to get you started.

WmRoot/wm.server.services.serviceInfo (checked it on version 8.2, not sure about the earlier versions)

Accepts a fully qualified name of the service and return the information about that service…also returns a message “Unknown service …” if it doesn’t find it…

please make a note …this service is in WmRoot package…SAG discourages the use of services in this package…

Thanks.

I have already prototypically implemented the check on file system level - an approach that is not very clean but working.

Using the WM internal service is an alternative I will evaluate.

So far, both solutions are a bit off from standard usage but will do its duty.

BTW: One advantage of the file system based approach is, that you also can apply it to documents, adapters, etc.

I am reading the node.ndf file and returning the service details (type, …)

The NSName (and related non-public classes) will work with any namespace element, not just services.

Ok, I can instantiate a NSName Object using e.g. a service name.
But besides invoking that service, I did not find any other use for that object using the API.

Yeah, as I mentioned, there are non-public classes that can be used to query the Namespace. Forum rules prevent me from listing them here.

Thanks Rob, I do not want to go there anyway. The file system approach is not much cleaner but simple and serves it’s purpose.

Can you please share the solution that you built! might be useful for someone who is in need!