Every WCF application has three primary components:
- A service class that implements one or more methods
- A host process in which the service runs
- One ore more endpoints that allow the client access to the service. All communication flows through the service endpoints.
Notice how the ServiceContractAttribute is defined for the interface, and how each operation's method signature is preceded by an OperationContractAttribute. If these are not both defined, the method is not exposed. Step Two: Implement the WCF Service Contract Now that we have our interface, we need to implement it in a service class. In my project, I've created a CalculatorService class that will implement ICalculator from step 1. Here is how CalculatorService implements each method:
The next step will be how to properly host the service we have created. This project is continued in part two. Here's a link to the completed application:
No comments:
Post a Comment