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.
Related
I have a project has two parts.
1- Windows form or WPF application that basically connects to database and write/read/update some basic text data (this part is already done).
2- On the other hand, I am currently developing an IOS app that can connect to remote database and read/write/update data.
What is the best way to connect the same SQLite or SQL database from both Windows forms app and IOS app.
Thanks in advance
The best way is creating an API/WebService which will be the interface between the database and your clients: WPF, iOS App and any other client you might want to add in the future.
Using a WebService is more secure, I guess you wouldn't want your database username and password being everywhere.
Using a WebService allows you abstract the data layer. Not using an API and using the connection to the database directly from your Apps will tightly couple your apps with the structure of your tables and any single change that happens in the database will force you to do the changes in the apps.
With WebService you decide what information will be available to the ones consuming it.
There are many others Plus on using WebServices but hope this are enough to clear your doubt.
Hey I'm trying to upgrade notifications service that uses task polling to see if there are new messages for a given interval.
My client is a WPF application and WCF in the server side.
I have 2 application servers with windows server 2008 r2 and load balancer between them.
I thought of implementing it with WCF Duplex binding and noticed it will be a problem to manage my users in 2 service instances (since I can subscribe user only to 1 service).
The trigger for sending messages is when data is manipulated by a user and is related to other specific users.
Another important point is that we plan to scrap our wpf application and revise our front end as web project (with angularjs probably..) and our backend from wcf to .net web api.
I read a bit about push techniques and came to this conclusion:
SignalR - the thing is, how will it work with web? (angular.js instead of asp.net)
Wamp - didnt find much about it but it looks promising
Websockets
.NET implementation (requires IIS 8 which means upgrading our servers)
socket.io - simple and great documentation and community. but I'm not familiar with nodejs.
What are your thoughts about how to implement it?
Thanks, Bar
I have a desktop application in C# and i want to make that a window service. Is it possible to make that application as a windows service? Basically i want an app that shows gui when needed and upone minimizing it goes to system try, and it should also appear in services... For application just take an example that my application have a timer and multiline text field and its also interacting with database and its showing timely status from database so when i need to see it i can start GUI from system try?
Any kind of help would be highly appriciated. Thanks!
You will need to separate your applications. Windows Service and desktop. You will need to build API hooks into your Windows Service to allow communication from your desktop application and the service. I would recommend WCF for this.
In a nutshell, a Windows Service should not interact with the desktop. It will run in a separate session than the session you are logged into, even if you are logged in as the same account the service is running under.
It is not possible to show GUI in a windows service.
What you can do is:
a. Seperate client logic from server logic, the windows service will perform the server side operations and will expose a WCF API to the client , which will handle the GUI related issues.
b. Use an external tool like Service-O-Matic to control your winforms application as if it was a windows service. see:
http://www.kwakkelflap.com/service.html
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.
I want to send simple data (geolocation data to be precise) from Windows Phone 7 application to a windows forms application and use it, as I'm a total beginner in this field I don't know which tools to use.
I searched about wcf services and tested this method but there's some issues: the data is sent from the phone application but isn't sent to the winforms application (guess something is missing)
If your know how to do this in a quick way, or have good tutorials I'll be thankful.
EDIT
I found this tutorial, it show how to connect directly wp7 application and desktop application without using sockets neither wcf service, I'm wondering if it is really works if the application isn't in localhost.
the like for the tutorial: wp7 tutorial
I had a similar problem and so I created a REST/JSON WCF service hosted in IIS with AppHarbor to provide the data. There's hundreds of ways to do it (Ruby/Heroku, etc..), but that particular one fits well within the Microsoft stack. I also needed to share route data and I used the WCF service to wrap the BingMaps services so that route computations are cached and shared. Considering that I had already created a local model, moving it out of my phone project into a service took less than a few hours (including the usual config hiccups, and forgetting to add the appharbor user to my bitbucket repo).
Consuming the service from WinForms (or any client) shouldn't be an issue as the service knows nothing about the client implementation.
Here's a tutorial from code project. REST WCF Service with JSON
I think you would need to implement some sort of server side solution which you could upload to on your Windows Phone and download from on your Windows Form application. This could be achieved using a WCF service which was connected to a server side database.
Another option would be to use sockets and communicate directly with your WinForms application. Check this tutorial on how to use basic sockets on WP7.