I have written a service getEnvironment which simply set’s the server environment type… The service contains a single map element… In the pipeline out I set a variable envType to “prod” in the production environment… Similarly “test” in TEST environment… The trouble is my team want’s me to change this service and set this variable by finding out the DNS name(Server Environment) at runtime instead of the hardcoding… I did not find any built-in service which returns the hostname/DNS name… Please let me know if there exists a service which return me these values or how should I implement this idea…
hi prashanth,
u can find the built in services in WmSamples package for server information(getServerInformation) and also in PS_Utilities package which u can find in webMethods advantage,
HTH
sri
Sri’s suggestion will work, but I think a better approach is to use a properties file. Or for a property like this, add a new propertyy to the IS Extended Settings list with a name/value pair like “watt.server.enviroment.name=PROD”. That way you can edit that setting from within Administrator and it is not affected by package deployments.
You can do this with:
wm.server.query:getExtendedSettings
or
wm.server.query:getExtendedSettingsVisible,
those are not visible in Developer but you can invoked them, or from java, or just insert some invoke step and then change the “Service” param in Properties panel.