DorkMonstuh
DorkMonstuh

Reputation: 851

Sending data via WCF

I was wondering how you can send data from the client to the host. Currently I have 2 projects and one WCF library. One of the projects is a pump which is the client and I want it to be able to send data to the host? Although I may have a misunderstanding of how WCF works. I was wondering if anyone could point me in the right direction. The problem requires me to use WCF. I want to be able to pass a list of strings to the host.

Upvotes: 0

Views: 2380

Answers (2)

Filip Savic
Filip Savic

Reputation: 3230

As faester already said, WCF is a large framework and you can not make a good application by just copy-pasting the code into your project. You should really read into the matter and then create your programming masterpiece.

faester gave you a link, but it's for basic WCF client-server communication.

Here are some good links on sending and receiving data via WCF:

  1. Data transfer and architectural overwiev
  2. Using the Message class

For a simpler, task-oriented view of how to send and receive data, see: Specifying Data Transfer in Service Contracts

I hope that this will help you and the people yet to come to this question.

Upvotes: 1

faester
faester

Reputation: 15076

WCF can send data over many different transport protocols like MSMQ and http. It also enables message security, distributed transactions and other more complex features of a distributed system.

You need to create a WCF service, which is available as a template in Visual Studio. The server should be hosted as a stand alone program os as a web application in IIS.

Afterwards you need to create a client, that can communicate with the server.

WCF is however a large and complicated framework and you should not expect to be able to just scratch the surface and build a system. You need some googling and could possibly start with MS own tutorials.

If you need real useful answers you should be more specific about your program and the client and server operations as well as the deployment scenario.

Upvotes: 1

Related Questions