Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello folks,

I have one windows service which runs on server. I have one html file(which is also deploy on IIS Like www.xyz.com/index.html) which has one javascript library which have number of function with arguments. I want to call specific function from this JS with argument using Windows service. Can it be possible to call JS function from Windows service??? give me some idea.......

Thanks in advance

KP Singh Chundawat
Posted
Comments
DamithSL 27-Dec-14 13:20pm    
is there specific reason to do that? what are those js function doing in your site?
KP Singh Chundawat 27-Dec-14 13:32pm    
Thanks for reply me ..js function extract some information from HTML file .so i need it to call ..If you have any idea then let me know sir ....
Sergey Alexandrovich Kryukov 27-Dec-14 18:52pm    
What is that supposed to mean? You have Javascript functions only on client side, and call them only on client side. Start from that.
—SA

1 solution

The answer to your question: no, you can't. There are many reasons for that.

Let me suppose that there is an event on server side, comming from the windows service, and you want all or some active clients to react to that (for example by sending some data not yet sent to the server side). The windows service will never be able to access the client. Neither can the web application hosted under iis. But your client can poll the web application for that specific event, which can poll the windows service using some IPC. Actually you could expose the windows service also, but I don't recommend that.

As an alternative SignalR[^] is a great tool you can use, but you still need to think about the client as the initiator of that communication.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900