Anyone know of a way inside the rules service itself to determine on which port it is running?
Hi Marc,
USoft has an off-the-shelf component OTS_WIN_PORT_INFO that returns information about port numbers.
When you import this component, it will add a component table too.
To find the Port number of your Rulesservice, you need its Process ID. I used a small .Net (C#) component to get that ID:
using System;
using System.Diagnostics;
class PRC_UTIL
{
public static int ProcessId
{
get
{
if (_processId == null)
{
using(var thisProcess = System.Diagnostics.Process.GetCurrentProcess())
{
_processId = thisProcess.Id;
}
}
return _processId.Value;
}
}
private static int? _processId;
}
Please, use a better class name (or add the method to an existing class).
With these two components you can create a query like:
select
*
from
OTS_WIN_PORT_INFO "wpio"
where
wpio.PROCESSID = PRC_UTIL.GET_PROCESSID()
;
This will retrieve all ports in use by the rules service. The port that is 'LISTENING' is your rules service port number. (wpio.STATE = 'LISTENING'). You can test this from the browser:
http://{hostname}:{portnumber}/{APPLICATION}/{USERNAME}/plain/SqlScript?$Password={pwd}&$SQL=select * from OTS_WIN_PORT_INFO "wpio" where wpio.PROCESSID = OTS_UTIL.GET_PROCESSID() and wpio.STATE = 'LISTENING'
Hope this helps.
Regards,
Robert
Â
Exactly what I was looking for, thanks
Reply
Login into the USoft Community
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.