Creating the service interface layer
In the previous section, we created a WCF project using the WCF Service Library template. In this section, we will create the service interface layer contracts.
Because two sample files have already been created for us, we will try to reuse them as much as possible. Then we will start customizing these two files to create the service contracts.
Creating the service interfaces
To create the service interfaces, we need to open the IService1.cs
file and do the following:
Change its namespace from
RealNorthwindService
to:MyWCFServices.RealNorthwindService
Change the interface name from IService1 to IProductService. Don't be worried if you see the warning message before the interface definition line, as we will change the
web.config
file in one of the following steps.Change the first operation contract definition from this line:
string GetData(int value);
to this line:
Product GetProduct(int id);
Change the second operation contract definition from this line:
CompositeType...