Call Windows Service from Browser

Go To StackoverFlow.com

1

I want to send data to a driver software via browser application with in same machine. If this driver can keep on listening to external connection via socket as a windows service, can I write a web application to send data to this driver by using php, applet or .net. Driver is written in C#. Is this possible and if so can someone show me a path/suggestions or any resource related to this?

2012-04-04 07:55
by M P Mathugama
Please clarify that you want to send data from the client (browser) or server?

You might want to use applets/flash if you wish to send data from client side.

You can use php fsockopen http://php.net/manual/en/function.fsockopen.php to connect to the socket via server - mim 2012-04-04 08:01

from client(browser) to directly software driver within same machine. No server should be used. By using java-script or applet can I do this. If so How? I didnt find relevant resource - M P Mathugama 2012-04-04 08:06


1

I do not know a whole lot about drivers...

But, if you can self-host a WCF service in the C# driver, than you can do IPC (inter-process communication) on the same machine. The WCF could expose multiple endpoints ie.) http, namedpipe, or tcp and the .NET web application can subscribe to the service and send data to the C# driver.

Also, if you use a http or tcp endpoint, i believe that the web application would be able to connect to the C# driver from another machine.

WCF Reference: http://msdn.microsoft.com/en-us/library/ms731082.aspx

2013-01-09 20:27
by Mausimo


0

you could use web sockets WebSocket, however your driver would have to handle the handshake.

2012-04-04 08:16
by Helikaon
Ajax driven http client calls to localhost + specific port will solve this if windows service can be written to listen http requests - M P Mathugama 2012-04-04 12:38
Ads