Building a WCF Service
Now that you have a better understanding about the building blocks of a WCF application, let’s cre-
ate our first sample application to see how the ABCs are accounted for in code. Our first step is to
define our WCF service library consisting of the contracts and their implementations.
This first example will not use the Visual Studio WCF project templates, in order to keep
focused on the specific steps involved in making a WCF service. To begin, create a new C# Class
Library project named MagicEightBallServiceLib. Once you have done so, rename your initial file
from Class1.cs to MagicEightBallService.cs and add a reference to the System.ServiceModel.dll
assembly. In the initial code file, specify that you are using the System.ServiceModel namespace. At
this point, your C# file should look like so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Do'stlaringiz bilan baham: |