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

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

Related

WCF client hosted in a windows service with a WPF UI

I have now a WCF service that is hosted inside a WPF application. It's running in a WCF server-client scenario where the client can call the server as well (duplex communications).
I would like to host the WCF client in a windows service, but I'd like to keep the WPF UI because of the functionality it provides when making calls back to the server (e.g. request information). I know that windows services don't have UI, but in this case I need it.
What best way is there to communicate between the WPF application and the windows service? (something better than sockets maybe?)
A scenario where this is useful would be something like:
from the WPF application I can choose what kind of information would be required from the WCF service acting as server,
this "command" would be sent to the windows service hosting the WCF client instance, and
using the the instance making the call to the server and
displaying the information in the WPF application via the WCF client service hosted by the windows service.
Thanks,
Adrian
Since the service is already running as WCF, how about exposing some extra "admin" methods on the WCF interface and have the WPF application interact with the service through those?
You'd have to put in a security layer to make sure only the legitimate user could call those new methods, but this solution might be the least work since the WCF infrastructure is already in place.

Socket Programming: Send message from outside Silverlight app into Silverlight app, NOT across two Silverlight apps?

I have little to no experience working sockets save for the last day or so of researching this specific scenario, so bear with me.
I have a standard .NET class library that is run from within a winforms desktop application. I also have a Silverlight Out-Of-Browser application that this class library/DLL must send messages to.
My issue with any example or sample I've found thus far is that they seem to always use the Silverlight application as the client and the outside source as the server.
In my scenario my DLL would need to attempt a socket connection to the OOB silverlight app (if it's running). If that connection succeeds, send a message to it.
So if I'm picturing this correctly, how would I about doing this in a lifecycle perspective?
The DLL would be loaded, and spin up a socket server, that server would then attempt a connection to a socket listener in the OOB silverlight app. If that connection succeeded, send a message?
This would also mean that when the OOB Silverlight app gets fired up, in the application startup, I would create the socket listener and set it to listen?
Thank you for any and all information. Again I've looked at several samples and read more than a few articles and my brain is fried. It's just not clicking with me for some reason.
And keep in mind this is for an "out of browser" instance of a Silverlight application. NOT a web hosted version.
This is the latest sample project I was looking at:
http://www.silverlightshow.net/items/SocketsLight-Silverlight-Sockets-Framework.aspx
You could use COM automation back to front. Silverlight OOB can connect to COM servers. What you want is the reverse - i.e. Silverlight OOB as a COM server. This is how you'd do it.
Design your Winforms app as a COM server that raises events that look like COM commands. e.g. instead of
event ButtonClicked(object sender, EventArgs e);
do this
event SilverlightDoThis(arg1, arg2, ...)

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 does my WCF Service communicates with my Winforms App Client?

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.

Resources