勇哥注:
此系列文章是梳理一下勇哥认为项目有用的WCF的知识点,读者须有WCF的开发经验。
1:WCF异常在配置文件
<configuration> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="serviceDebuBehavior"> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <services> <service name="Artech.WcfServices.Service.CalculatorService" behaviorConfiguration="serviceDebuBehavior"> <endpoint address="http://127.0.0.1:3721/calculatorservice" binding="ws2007HttpBinding" contract="Artech.WcfServices.Service.Interface.ICalculator" /> </service> </services> </system.serviceModel> </configuration>
本篇博文只是简单说下WCF中的契约的种类、作用以及一些简单的代码示例。在WCF中契约分为服务契约、数据契约和消息契约。下面对这几种契约进行简单的介绍。
学以致用”,如果仅仅是希望能够在项目中合理地应用WCF,那么对于程序员而言,可以有两种选择,一种是“知其然而不知其所以然”,只要掌握了WCF的基础知识,那么对于一般的应用就足够了。
Powered By Z-BlogPHP 1.7.3
Copyright www.skcircle.com Rights Reserved.