This project presents a basic WCF Service Application and client “tester” console application in same Visual Studio solution. The WCF Service was hosted using IIS Express. A simple console “test” application connected to the service through a proxy. The service provides basic mathematical operations contracts including:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[OperationContract] double Add(double value1, double value2); [OperationContract] double Subtract(double value1, double value2); [OperationContract] double Multiply(double value1, double value2); [OperationContract] double Divide(double value1, double value2); [OperationContract] double CircleArea(double radius); |
The client is expected to access the service using information available through the WSDL. I created my test client application by building a proxy using svcutil.exe http://localhost:portnumber/MathService.svcutil
Note: You should update the client proxy or reference to the server before running this in your Visual Studio IDE by first going to TestClient (Console Application) –> Connected Services –> MathServiceRef and selecting “Update Service Reference”.
Demo
![MathService Service](https://i0.wp.com/portfolio.katiegirl.net/CSharp/WCF%20Services%20Applications/BasicWCFServiceApplication&ClientConsoleApplication/demo/MathService.jpg?resize=749%2C505&ssl=1)
![IIS Express](https://i0.wp.com/portfolio.katiegirl.net/CSharp/WCF%20Services%20Applications/BasicWCFServiceApplication&ClientConsoleApplication/demo/ServiceHostedonIISExpress.jpg?resize=663%2C607&ssl=1)
![Client Console Application](https://i0.wp.com/portfolio.katiegirl.net/CSharp/WCF%20Services%20Applications/BasicWCFServiceApplication&ClientConsoleApplication/demo/WCFClientTesterConsoleApplication.jpg?resize=529%2C413&ssl=1)