DISCLAIMER(s): you’re hacking into non-public services, any upgrade or patch might break this functionality, so make sure you update your upgrade policy/procedure to include regression testing of any service that calls this stuff. Also: I don’t work for webMethods, so don’t go running to webm support for help if you use this
Ok, so the service in question is
It takes in an input called listenerKey and another one called pkg.
listenerKey is of the form:
(replace c:\temp\filepolling with the directory that it is monitoring…)
pkg is the package which has the definition saved in it.
If you don’t know the directory that it is monitoring then you can retrieve the list of them (but you’re in trouble if you have more than one) by calling wm.server.ports:listListeners to retrieve all that sort of information.
As a side note: I’d recommend if you’re going to use this functionality in more than one service, wrap it up in another service so that you can insulate the rest of your code from any API changes webMethods might make to the Integration Server’s admin services.
WmUnit - Test framework for webMethods