i didn't use signal R before in projects. And would like to do the following.
Multiple users in our web application(but not all). Should get a button. That sends a message(through Signal R) to a windows Service /or console application to trigger an action.
After the Action is finished the application shoud respond to the client that its done.
If you are having problem with Calling the windows service from the Web Application. Here is a good article which shows how to do this, please take it as reference.
Or you can just use ajax to achieve your requirements instead of using SiganlR.
Best Regards,
Jean
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
My problem is that is that the Windows Service is on a other computer. And i cannot get one to one signals working from my frontend. I would like to trigger a action in the service.
My problem is that is that the Windows Service is on a other computer.
Please try use the following code to start windows services on remote server.
private string servicestart(string compname, string service)
{
ServiceController sc = new ServiceController();
sc.ServiceName = service;
sc.MachineName = compname;
string result = sc.Status.ToString();
if (sc.Status == ServiceControllerStatus.Stopped)
{
try
{
sc.Start();
sc.WaitForStatus(ServiceControllerStatus.Running);
result = sc.Status.ToString();
}
catch (InvalidOperationException)
{
// do something
}
}
return result;
}
string status = servicestart("computerName", "Service");
Note that : make sure you're able to start that service remotely using the current permissions and credentials.
Best Regards,
Jean
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
3 Points
8 Posts
Signal R Webclient to Windows Service
Oct 10, 2017 09:47 AM|vdboots|LINK
Hi There,
i didn't use signal R before in projects. And would like to do the following.
Multiple users in our web application(but not all). Should get a button. That sends a message(through Signal R) to a windows Service /or console application to trigger an action.
After the Action is finished the application shoud respond to the client that its done.
Does anybody has a example code.
Thnx
Contributor
6490 Points
2525 Posts
Re: Signal R Webclient to Windows Service
Oct 11, 2017 02:06 AM|Jean Sun|LINK
Hi vdboots,
What's the problem do you face now?
If you are having problem with Calling the windows service from the Web Application. Here is a good article which shows how to do this, please take it as reference.
http://www.csharp-examples.net/restart-windows-service/
If you are having problem with how to use SignalR, please check the following tutorial.
https://www.asp.net/signalr
Or you can just use ajax to achieve your requirements instead of using SiganlR.
Best Regards,
Jean
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
3 Points
8 Posts
Re: Signal R Webclient to Windows Service
Oct 11, 2017 06:38 AM|vdboots|LINK
Hi Thanks For your Answer,
My problem is that is that the Windows Service is on a other computer. And i cannot get one to one signals working from my frontend. I would like to trigger a action in the service.
Contributor
6490 Points
2525 Posts
Re: Signal R Webclient to Windows Service
Oct 12, 2017 03:16 AM|Jean Sun|LINK
Hi vdboots,
Please try use the following code to start windows services on remote server.
Note that : make sure you're able to start that service remotely using the current permissions and credentials.
Best Regards,
Jean
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.