Introduction
This article is trying to explain the simple steps that require to start creating and using a simple WinFx Service.
System requirement
For this article, I installed WinFX Runtime Components 3.0 Beta 2 and MICROSOFT WINDOWS SOFTWARE DEVELOPMENT KIT - FEBRUARY CTP.
The Service
For simplicity, we will use the service that comes as a default with the WinFx project. The class MyService implements the interface IMyService which contains a method MyOperation1. We implemented this method, it takes a string parameter and return it with a Hello message.
Creating the WinFx Service
Open Microsoft Visual Studio 2005 and create a WinFx Service.
File-New-Web Site-WinFx Service
Now run the service and you will get
Click on the service.svc and then wsdl link to see the detail of the service.
The Client
The proxy and configuration file.
Open Visual Studio Tools and Choose the Visual Studio 2005 Command Prompt.
Choose a working directory and run the command:
svcutil.exe http://localhost:1035/myWinFxService/Service.svc?wsdl
Two Files output.cs and output.config will be created with successful operation. output.cs is the Proxy and output.config is the configuration file.

The Client:
Open the Visual Studio and create a C# windows application project.
- New Project-Visual C# Project-Console Application. Name it WinFxClient.
- Rename the files output.cs and output.config to MyServiceProxy.cs and App.config respectively and copy them to the project folder. (we need to rename the file to MyServiceProxy as our service name is MyService)
- Add these files (MyServiceProxy.cs and App.config) to the project.
- Add a reference of the System.Runtime.Serialization and System.ServiceModel.
- Modify the Program.cs file, create the object of MyServiceProxy and call the method the MyOperation1. (You can copy the following code and paste).
a. Program.cs:
using System;
using System.Collections.Generic;
using System.Text;
namespace WinFxClient
{
class Program
{
static void Main(string[] args)
{
MyServiceProxy p = new MyServiceProxy();
Console.WriteLine(p.MyOperation1("Priyokumar"));
Console.ReadLine();
}
}
}
Running Application
- Run the project
- We will get Hello: Priyokumar as output.
The output:

Life needs Servicing too!!!!