WCF中配置文件也着实迷倒了一片.......
现将serviceModel节点下节点配置做详细了解。
【bingding节点】
<span style="font-weight: normal;"> <bindings>
<!--指定一个或多个系统预定义的binding,然后在这个指定的binding中建立一个或多个配置,供终结点endpoint使用-->
<wsHttpBinding>
<!--启动事务流-->
<binding name="WsHttpBinding_Default" transactionFlow="true" closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="false">
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings> </span>
<span style="font-weight: normal;"> <bindings>
<!--指定一个或多个系统预定义的binding,然后在这个指定的binding中建立一个或多个配置,供终结点endpoint使用-->
<wsHttpBinding>
<!--启动事务流-->
<binding name="WsHttpBinding_Default" transactionFlow="true" closeTimeout="00:10:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" useDefaultWebProxy="false">
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings> </span>
【behaviors节点】
<behaviors>
<!--定义service的行为-->
<serviceBehaviors>
<!--一个或多个系统提供的behavior元素-->
<behavior name="Authority"> <!--behavior唯一标示,<service>元素的behaviorConfiguration属性指向这个name-->
<!-- httpGetEnabled - bool类型的值,表示是否允许通过HTTP的get方法获取sevice的WSDL元数据 -->
<serviceMetadata httpGetEnabled="true"/>
<!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
【services节点】
<services>
<!--name-指定这个service配置是针对的哪个服务,既实现contract契约的服务类(命名空间.类型名)-->
<!--behaviorConfiguration-指定在<serviceBehaviors>节点下的behavior的name值。<behavior>值给这个service制定了一些行为-->
<!--address-指定这个终结点endpoint对外的url,可是绝对地址,也可以是相对于baseAddress的相对地址。如果此属性为空,则这个终结点endpoint的地址就是baseAddress contract-指这个终结点对应的契约contract的权限定名(名称空间.类型名),这个contract应该被service元素的name指定的那个service实现-->
<service name="ITOO.Authority.WCFService.AuthorityServices" behaviorConfiguration="Authority">
<endpoint address ="" binding="wsHttpBinding" bindingConfiguration="WsHttpBinding_Default" contract="ITOO.Authority.ServiceWCF.IAuthorityServices" />
</service>
</services>