The IArea interface, created as service contract in the previous tutorial:Defining Service contract in WCF, defines the basic functionality of the WCF service that will be exposed as service methods. The interface just outlines the operation contracts as part of service contract which need implementation of methods for applying the logical code. In this second step we will implement the IArea interface by creating a new C# class with name AreaService.
Implementing the WCF Service Contract
Continuing with the same WCFService console application created in the previous tutorial: Defining Service contract in WCF, now let's implement the IArea interface:
1. Create a new class with name AreaService by right-clicking on the project in the solution explorer by choosing New Item from the Addmenu.
2. Next implement the IArea interface to the class:
3. Implement each method defined in the IArea interace within the AreaService class:
Now we are finished with creation of service contract and its implementation steps. Continue to next tutorial: Hosting and Running a Basic WCF Service to compile and run the service code.
Responses
0 Respones to "Implementing Service Contract in WCF"
Post a Comment