Retrieving Current Port of WM Server

Hi

I am trying to retrieve the current port of the WM server. I am using getCurrentPort() of ServerAPI.

In run time i am getting a value of -1 but if i run my service in debug mode the value returned is correct lets say 5555.

I would like to know why this is happening or if there is an alternative to retrieve the current port.

Regards

Sreedhar

I have raised an SR for the same, shall update the post when i receive the response, might be useful for others in future

Hi
You can use the following service WmAdmin/wm.administrator.user:getAllServers.
Even WmRoot services can be used to retrieve the port.

Thanks
Muralidhar