WCF noob在这里。 我正在探索Visual Studio 2010中的在线模板:WCF REST服务模板40
有谁知道要学习的好样本?或者至少指出正确的方向...... 我正在尝试创建一个从数据库中查找EmployeeID的服务,以返回一些序列化的员工配置文件数据。
基本上,我想知道它在哪里(通过更新的方式,WCF 4.0,RESTful,Json)。 -ConnectionString -请求参数 -etc
希望Url看起来像这样: http://localhost:55123/EmployeeService/EmployeeLookup/ {雇员}
我的下一个任务当然是在某个网页上使用该服务。
提前感谢您的指导。
答案 0 :(得分:2)
答案 1 :(得分:1)
本周末我刚刚完成了这个10部分的样本(它应该是12,但他们从未发布过最后2个)。它使用数据库来检索任务和用户信息,并可能让您感觉到您正在尝试做的事情。
我发现它非常有用且信息丰富,去年我一直在做SOAP WCF(3.5)+。
Introducing WCF WebHttp Services in .NET 4
到目前为止发布的10个部分是:
1. Getting Started with WCF WebHttp Services in .NET 4 2. Clients and the Automatic Help Page in WCF WebHttp Services 3. Updating State in WCF WebHttp Services 4. Automatic and Explicit Format Selection in WCF WebHttp Services 5. Error Handling in WCF WebHttp Services with WebFaultException 6. Using Routes to Compose WCF WebHttp Services 7. Integrating ASP.NET Output Caching with WCF WebHttp Services 8. Returning Custom Formats from WCF WebHttp Services 9. Creating Views in WCF WebHttp Services with T4 10. Conditional GET and ETag Support in WCF WebHttp Services
根据这个问题,前4个可能是您最感兴趣的,但所有10个都是有价值且信息丰富的。