In the PEDRAMR blog last week, I saw someone ask if the RESTful WCF service can be invoked asynchronously, and the following is the implementation details of the WCF implementation of the asynchronous call restful. Through this study, the following knowledge is helpful to master:
How to set restful support for WCF
How to invoke the RESTful WCF service asynchronously
Step One: Create a solution: ASYCALLRESTFULWCF, which contains the following four projects:
Project name |
Note |
Asycallrestfulwcf.contracts |
A contract project for a WCF service that contains the definition of a service contract and a data contract |
Asycallrestfulwcf.service |
Specific implementations of WCF services |
Asycallrestfulwcf.host |
Hosting of WCF Services |
Asycallrestfulwcf.httpclient |
To invoke the WCF service client asynchronously in an HTTP manner |
Step two: Create service contract IService.cs and data contract in Project Asycallrestfulwcf.contracts Person.cs