My Goal:
So my goal is to connect to Solution Control Server and get a few informations like; what is the current “Status”, which “Mode” is it running, etc.
What I have:
So far i have tried a few different things, the most successful two are the following:
Best solution (so far):
string server = “tco://sisccpxxxx01:9201”;
TimeSpan timeout = new TimeSpan(0, 0, 0, 0, 3000);
SolutionControlServerProtocol scsp = new SolutionControlServerProtocol(new Endpoint(new Uri(server)));
scsp.ClientName = “SomeName_Main”;
scsp.ClientType = Genesyslab.Platform.Management.Protocols.SolutionControlServer.ControlObjectType.Solution;
scsp.Open(timeout);
I get the following error:
Genesyslab.Platform.Commons.Protocols.ProtocolException: Exception occured duing channel opening —> System.Net.Sockets.Socket.Exception: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.238.xxx.xxx:9201 TRANSLATET (There is no connection because the target computer refused the connection).
I’m guessing the problem is that I don’t give a id (scsp.ClientId), sadly I don’t now what the id is and where i get it from. Can you help me out?
2nd solution (Like post I linked):
TimeSpan timeout = new TimeSpan(0, 0, 0, 0, 3000);
Endpoint endpoint = new Endpoint(name, host, port);
SolutionControlServerProtocol scsp = new SolutionControlServerProtocol(endpoint);
scsp.Open(timeout);
I get the following error:
Genesyslab.Platform.Commons.Protocols.ProtocolException: Exception occured duing channel opening —> System.Net.Sockets.Socket.Exception: Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte 10.238.xxx.xxx:9201 TRANSLATET (There is no connection because the target computer refused the connection).
Same error as above.
One possible reason could be that you have a spelling mistake on your server string..
string server = "tco://sisccpxxxx01:9201";
It should be ‘tcp://’ not ‘tco://’.
Other things it could be:
Is the SCS Port opened on your firewall.
Can the host name be resolved to an IP Address?
Do you have the correct port number?
For me this code works:
try
{
string server = "tcp://demosrv:7003";
SolutionControlServerProtocol protocol = new SolutionControlServerProtocol(new Endpoint(new Uri(server)));
protocol.Open();
RequestGetApplicationInfo req = RequestGetApplicationInfo.Create();
req.ControlObjectId = 117;
IMessage res = protocol.Request(req);
if(res is EventInfo)
{
EventInfo info = res as EventInfo;
Console.WriteLine("Status: " + info.ControlStatus);//6 = Running
}
Console.WriteLine(res);
}
catch(Exception ex)
{
Console.WriteLine("Error :", ex);
}
First of all sorry for my late response, was busy the past few days. Then I’m thankful for your response!
I’ve tried what you send me and it looks better, yet still doesn’t work. The problem I get is still at protocol.Open();, but now I get a different error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
So it looks better but I’m still missing something, do you know what?
string server = "tcp://sisctestsrv01:9201";
SolutionControlServerProtocol protocol = new SolutionControlServerProtocol(new Endpoint(new Uri(server)));
protocol.Open();
RequestGetApplicationInfo req = RequestGetApplicationInfo.Create();
req.ControlObjectId = 117;
IMessage res = protocol.Request(req);
if (res is EventInfo)
{
EventInfo info = res as EventInfo;
Console.WriteLine("Status: " + info.ControlStatus);
}
Yes I’m pretty sure, tried it with 2020 which got me same error. Got the information through SCI, is there an other way how i could find out which port I should use?
The screenshot you have sent shows that Application Name ‘Pulse’ of type ‘DataSourcer’ is using port 9201. That will be why you can’t connect using the SolutionControlServerProtocol.
Do you know what the port number for your Solution Control Server is ? That would be an application of type ‘Solution Control Server’
Oh I’m actually dumb. facepalm
I’m trying to get the informations from a application on a SCS, not the SCS itself. That explains alot, have to do this differently.
Thanks for you help guys and sorry that i wasted your time… :-[