Call a function of windows application from wcf service function - c#

Can I Call a function of windows application from wcf service function,The main purpose of the whole application is: Windows service will detect some event and will show something on windows form application for recognizing the event by the user. Windows service and windows form application should communicate with each other by WCF service.
Thanks in Advance.

Normally web-services are developed to be called by the clients.
To send messages to client, which is the Windows Forms application in your case can be done
Long Polling or
WCF TCP/IP bindings.

Related

Restart Windows service from another service

I am developing a Windows Service that will control a group of windows application and run them on scheduler given from webservice.
I am not able to Start/Stop the services due to security issues. I have tried this solution but it did not work.
Try use WMI for manupulation of windows service state. Read here

Consume WCF Service in windows 8.1 mobile app developement

I am creating windows 8.1 mobile application where i want to consume WCF service.
I know how to call Webservice from windows 8.1,simply we call the url of webservice.
for ex: http://192.168.0.102/MobilApp/SrvOMM.asmx/FunCheckLogin?username=abc&password=abc
above url we call through http client and it call and return the result same thing I want to call in WCF service.
I have created WCF service and checked it in Test Client its working fine.
when i am creating url as we create for web service and hitting it, it returns an error.
I am unaware of WCF web.config settings like endpoints,service behaviour and etc. if is there anything we need to mention in configuration file please let me know.
Just wanted step by step process to consume WCF service in windows 8.1 mobile app.
Thanks in advance
Consuming a WCF service in windows 8/8.1 can be done. See this blog:
http://blogs.msdn.com/b/piyushjo/archive/2011/09/22/wcf-in-win8-metro-styled-apps-absolutely-supported.aspx

Exposing WPF or WinForms application as API or service

I have WPF application and i have to implement it with some other application on same PC.
It is request that my app must be accesed with api or service, and also to hide GUI totaly.
So i need advice on api or service for my application, should i create windows service of WCF application, so other application (JAVA application) can call my app and get returned string.
Any suggestion on this case is more then welcome!
If you want to have WPF application, you can host a WCF service within your WPF application. Read for example: Running a WCF listener in a WPF application
I would do both - a WCF service hosted within a windows service, you can throw away WPF completely.
The WCF's BasicHTTPBinding works well with Java's javax.xml.ws.Service.

connect ASP.NET web application to Windows Service application

I have one windows service application and one ASP.NET web application, both created by C#. Both applications get data from the database(SQL server).
Once I update database from web application, how could I inform service application to reload data from database?
Right now our solution is to use service controller to restart windows service application. Is there any low cost solution, like communication between service application and web application?
By the way, my boss hate polling method...
If wcf is a choice, can anyone post some materials?
Thanks a lot!
you can implement workflow services that runs as a windows service. That service must have an activy that can be called over net.tcp request and processes your request. I'm using this solution and works fine.
Other way is the service use the database to check if it's necessary to perform the reload.
You can take advantage of Service Broker
In a nutshell: using the SqlDependency class you can wire up an event in C# that will fire whenever a table gets updated. At that point in time, you can re-load the new data.

Communication between a desktop application and a web application

I have a desktop and web application connected to same database.
Which is the most preferred method to make them communicate with each other?
You should use SOA and then both your desktop app and web app should communicate with the Service.
And the Service will be responsible for communicating with the database.

Categories