Windows Communication Foundation(WCF) that is part of .NET Framework 3.0 is in the line of Microsoft(MS) classic work of abstraction. MS have been innovator in providing abstraction over various technologies from many years. In the same tradition I do believe WCF is another achievement. Undoubtedly they understand the difficulties in any technologies being faced by technology implementors and then they use their experience to nake the technology simple by intoroducing the layer of abstraction. Let me talk about WCf in particular now
1. First you need to download and install Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation).
Oops, looks like it needs a windows validation (bit of a problem if you have a pirate copy )
2. Once the installation is complete, start Visual Studio to create the project.
Goto File->New->Web Site, and you’ll see a new template called WFC Service.
Click OK to create an empty WCF Service.
3. Time to get started with the coding
Service.svc
Only a small change here – the name of the service
Web.config
Enable metadata publishing and change the name of the service.
Service.cs
This is the code for the service.
4. Run the service – click F5
This is what you get on the browser. So, lets do what they want.
5. Run the following on you command on Visual Studio Command Prompt
svcutil.exe http://localhost:1479/GeoWFCService/Service.svc?wsdl
Watch out, the path might be different . And if you don’t know what Visual Studio command prompt is
6. Let’s create the client
Create (or rather add) a new project; this could even be a website
7. Then run the service – Ctrl + F5
8. Add a web reference to the service
8. Copy the GeometryService.cs created by svcutil in step 5 to the clients working (main) folder and add them to the project
You should also copy the configurations of output.config created by svcutil to app.config
9. Again time for coding
Form1.cs
Set the textboxes and labels with appropriate names.
10. When you compile you’ll get a set of error because some assemblies are not referenced. Add references to them
11. Now see how it works
Start the service if haven’t done so already, and run the client
Wow! It works
Ok, hope you learned something with this and I got to go study for exam