How does my WCF Service communicates with my Winforms App Client? - winforms

I am currently developing a C# Windows Form Application that I intend to let it interact with a server. The server will receive posting from a mobile application that I have developed and whenever a posting is received, my Windows Form Application should be notified and give me a notification.
E.g. My mobile application sends an message over to my server. Once my server receives the message, my windows form application should display a new notification showing the content of the message received
The WCF Service has been done up in a seperate project file as I need the client to connect to the Service instead of hosting the service in my client project file. What I would like to ask is how does the service communicates directly with my winform app? Such as updating the UI of my winform app everytime a alert is received.

It sounds like you are looking for a Publish Subscribe Framework. This will have your windows forms application act as a client to the server to subscribe for notifications, then act as a server to receive notifications as the mobile application posts come in.

Related

Want to use SignalR in Windows Application to sync my clients

i want to create a application where i will use a Windows application as a server and a web application as a client.
Now i want to sync my client(web application) with my server(Windows application).
Both Web and Windows applications are in .NET4.0
Can any one help me on this ?
SignalR supports self-hosting. See https://github.com/SignalR/SignalR/tree/master/SignalR.Hosting.Self
You should be able to start the host directly from inside a Windows application or a Windows service. Your question wasn't clear, but I inferred an application due to the winforms tag on the question.
As long as your application is running, web clients should be able to communicate with your SignalR server code.

WCF and multiple clients

I have a WCF hosted in IIS, at the same time I have two clients, a WPF application and a Window Phone Application. My program work in the way that, the Window Phone Application will send a Message to the WCF and then the WCF will send it to the WPF application. How can I achieve it?
I have take a look at callback, but I believe what it does is to return a message back to the Window Phone Application after the Phone Application consume the WCF service. But what I want my program to do is to send the Msg from the Phone App to the WPF application instead.
please guide me. Thank you!
I would probably do it this way:
inside the WPF application, host a second WCF service to receive that message - your WPF application becomes a WCF server
when a message comes in from the Windows Phone into your WCF service in IIS, that service class then becomes a WCF client to the WPF app and send that message onwards to the other WCF service
Callback won't work - since callback can only call back to the original caller (your Windows Phone, here) and that's not what you want.

How do I display a message in my WCF Application?

I am currently developing a WCF Publish Subscribe service on a windows form application. How do I code it such that whenever the publisher publish something, my WCF Service would display a message in the winforms app saying :
Post has been sent to all subscribers at [Current Time]
Do I have to create another callback channel? Or just another service contract.
Thanks!!
I am assuming that you are publishing events by sending WCF calls from your windows forms application.
In this case you can do this with events.
When your WCF service sends the message, it also rasises an event. In the shell of your windows application you catch the event and display a message box.

Inter Process Communication between Silverlight OOB & Non-Silverlight Desktop Application

I have a Silverlight OOB Application installed, and I want to send messages to this application from any non-silverlight desktop application (Let this application be any WinForms, or Console Application). How can I achieve this?
For anyone looking over this old thread, you can create a duplex wcf service using http polling. Call the service from any application, the silverlight client can be registered as a callback and then receive messages directly from the server.
More reading:
http://msdn.microsoft.com/en-us/library/cc645027(v=vs.95).aspx

silverlight app realtime update design

I have a winform app, which takes live image from an ip camera, and detect vehicle license plate number from the image. Now i want to make a silverlight app which can connect to my winform app or some kind of service app, and the silverlight app gets updated whenever a new license plate number is detected, what service/architect should i use to make this possible?
Thanks for you advice.
Your going to need the following...
An IIS server that exposes a WCF service. Your Silverlight application can be running in any browser in any location and from time to time it needs to poll for new data by making a request to the WCF service asking for the latest updates. Your WinForm application can send new data to the WCF service whenever it has new data. The WCF service running in IIS acts as the buffer that caches the incoming updates from your WinForms application that passes it back to any number of Silverlight clients that request the latest data.

Resources