Reputation: 2011
I'm just starting out with WCF web services, and I'm having a really hard time finding a very simple tutorial, so I thought I'd ask some questions here.
Here's my setup: I have a WPF desktop application that needs to send data over the internet to a web service on our server.
The way I see it, I have at least these four options:
Can anyone tell me which is the best choice, and then maybe point to a tutorial to help me get started along that route?
Upvotes: 2
Views: 1212
Reputation: 2011
I managed to finally find a very clear start-to-finish tutorial on propping up a WCF web service here. I set everything up according to the tutorial, and so far it works very well. Hopefully there won't be any problems later with deployment or maintenance--guess we'll see.
Incidentally, it uses the New Web Site --> WCF Service template which other posters here have explicitly said not to use. I don't mean to sound contentious, but it seems to work me.
Upvotes: 0
Reputation: 56500
This is all rather subjective of course
If you already have a solution for your desktop application then I'd suggest you add a new WCF service application project to your solution and keep everything in one place. You can also set Visual Studio to run both applications when debugging, so you can actually check everything works together.
If you were writing a separate set of services, to be used by multiple client programmes which all exist in separate solutions I'd have option 2, and then option 4 when you want more flexibility such as hosting the services in a command line application or windows service.
Upvotes: 2
Reputation: 351516
Here is a good (if not a bit dated) "hello world" WCF tutorial: Windows Communication Foundation (Indigo) Hello World Tutorial:
This first tutorial will look at installing WCF (as part of the .net Framework 3.0), including the Visual Studio 2005 integration, and producing a first simple "Hello World" service to demonstrate some of the key concepts of the platform. The samples are all in C#, but I can spin off VB.Net equivalents if there is sufficient interest. Also, previous versions of this series (that targeted various pre-release versions of WCF) used Notepad and the command line to build and compile WCF services. This latest version makes use of Visual Studio because, especially with the RTM release, I suspect that is what most readers will be using. If you're interested in crafting your services by hand to explore the underpinnings of WCF more closely (or to obtain the asynchronous implementation, as you will see further down), let me know and I'll update the earlier samples. So, with that all covered, let's get to installing and using WCF!
Upvotes: 0