How to transfer an object p2p via internet using WCF C# - c#

How to transfer an object p2p via internet using WCF C#?
I have an .NET desktop application which is running on 2 different computers which are located in different countries . But now I want to transfer a object from one application to another using WCF .
is there any way to transfer an object from one application to another application via internet using WCF C#
I mean, for that where should I host the WCF service and is this done by WCF callback service?

Here is a pretty detailed article on using Peer-to-Peer programming with wcf and .NET Framework 3.5.
With a little work you could probably tie a SignalR client into your Winforms app. I have never tried to wire up a signal R client in a library. SignalR was designed for p2p and it may offer more functionality depending on your requirements.

Related

What are differences between UDP and WCF in SOAP?

I am now working on a client-server communication project. I implemented the server using UDP client method by simply passing text strings between client and server. But I would like to change it to WCF method. I did some research online about WCF but still cannot figure out what are the difference between WCF and UDP. Need some explanation about it.
You are attempting to compare two different concepts. Per the Microsoft web site,
Windows Communication Foundation (WCF) is a framework for building
service-oriented applications.
https://learn.microsoft.com/en-us/dotnet/framework/wcf/whats-wcf
WCF supports a variety of formats - not just SOAP. WCF also supports a variety of transports - one of which is UDP.
The answer to your question is WCF is a client-server communication framework that supports, among many other things, SOAP using UDP.

Client-Server communication- Looking for best solution

I have an application in WPF c# which will run on client machine. Another application (maybe some kind of service) on a particular server will be running all the time and will wait for any incoming message from the client app. As soon as the server receives a request from any of the client application, it triggers a command line process and also responds to the client about the staring info(whether it was successful or not) and as well as when the command line process is finished it again responds to the calling client application that it got finished.
I am new to in this area.
So my question is should I use normal windows service or Web service or WCF?(Some kind of link to a demo project will really help). Any other suggestion are also welcomed.
You did not mention if your clients will be outside of your firewall or with in the same intranet. We have intranet scenario, and we use WCF service that communicates with WPF based applications over the internal network. WCF provides Duplex feature which enables two-way client server communication using an easy to implement programming model. I recently wrote an article on this and it can give you a head start for the WCF way.
However, WCF does not have the best support for callbacks over the internet and you may have to look in to effectively using it in your case. But if it is intranet, then my suggestion is surely to go for the WCF way. Hope it helps.

How to do client-server over the internet

We want to create apps that connects to our database (Sybase ADS, connectable via .NET) over the Internet. The clients will include a windows forms app and probably an android app for phones and devices.
I know C#. I'm new to Web apps and webservices so bear with me here.
I'm thinking maybe the best way is creating a webservice in C# to run on IIS that will interrogate the ADS database using ADO.net.
So the webservice will expose methods via WCF that can be consumed by the clients.
The clients then invoke the methods via WCF. Am I right in thinking WCF will return data in .net XML objects?
Also can .net Forms consume XML objects easily?
The apps would have bespoke restricted access using credentials.
How does this approach sound? Any performance or security issues to think about? The data is not exactly classified but I wouldn't want snoopers to be able to pick up phone numbers etc.
Can most security be sorted out by just going from http to https?
What about performance. Presumably slower than if the apps were just connected using ADO.net to ADS on the LAN. Does WCF use bufers for http requests?
E.g. can you can start reading the stream on the client before the whole http request has finished? I'm thinking for populating list boxes of large record nos. etc

How to communicate between a windows service and a desktop application running on different machines

I am writing a notification client desktop application to be installed on multiple machines on a single network. These clients will communicate with a central windows service running on a single machine within the same network. Both the client and service are written in C#.Net. I am trying to determine what technologies or frameworks I should use for communication between the client apps and the windows service. I hope to use a push notification pattern instead of polling from the client.
So far I have looked into SignalR and WCF. WCF with NamedPipes looked promising, but I saw that a limitation of the WCF NamedPipes implementation is that it has to be on the same machine, so that won't work for me. SignalR seems like a good option, but I wasn't sure if there is another framework out there that won't require hosting a web server to support HTTP.
Any Suggestions?
You can consider MSMQ to send messages. https://msdn.microsoft.com/en-us/library/ms978430.aspx
This framework does not require anything special, as it is included with Windows. You may need to install the MSMQ as a Windows Feature. In my use it has been a pretty good utility that allows notifications and a host of other features.

Connect Windows Mobile to client PC over WIFI

What would be the best way to transfer a string across a network from a windows mobile device(so .net) to a .net app running on a pc on the same wifi network?
Would normal sockets work or would i use something like a webrequest?
The client can be any version of .net.
Thanks
For application there is no matter what type of connection is used, because it is incapsulated inside net-related classes.
On desktop you may use
TcpListener http://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.aspx
HttpListener http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
WCF
Web Service
ASP.NET Handler
These classes allows you to map some URL like http://{PC-name}/somepath to code executed by your applcation.
On mobile device you may use some classes allows you to make request using that URL. Also if your desktop application publish web service or WCF service, you may add reference to this service to mobile application and get strongly-typed interface to operate with desktop application. It is preferred way as for me.

Categories

Resources