This is a simple entry-level instance that is designed to experience the process of writing a WCF project. The
is preceded by a simplest instance of 6 steps.
1, create an empty solution called WCF, and then right-click on him to add a WCF Service Library project
for this solution The
WCF Service Library is added, resulting in the following
2, press the "F5" button to run the WCF Service Library, click the service method in the pop-up "WCF Test Client" window to enter the relevant parameters, and then tap the "Call" button. Observe return results
3, add a Web application. Right-click "Add Service Reference",
Click "Discover" in the pop-up window, select "Service1" and click "OK".
4 Drag into the Web application page 4 controls, a text box, a label, and two buttons.
5. Add a button to respond to an event with the following code:
6. Now set the Web application as the startup item and click F5 to test the results of the program.
text box input, click the "Call" button, will display the results returned in the label