我正在尝试更好地获取 WCF配置文件,以便我可以更轻松地处理更复杂的场景.通常情况下,我正在重新审视我对基础知识的理解.因此,这提出了一个问题,绑定配置和行为之间有什么区别?我不是在问什么是绑定(即netTcpBinding等等).我明白了.
所以假设我有一个包含多个配置的配置文件用于该单个绑定:
<netTcpBinding>
<binding name="LargeMessages" maxBufferPoolSize="5242880" maxBufferSize="5242880" maxReceivedMessageSize="5242880">
<readerQuotas maxDepth="256" maxStringContentLength="16384" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None"></security>
</binding>
<binding name="LargeFiles" maxBufferPoolSize="15728640" maxBufferSize="15728640" maxReceivedMessageSize="15728640">
<!-- 15MB max size -->
<readerQuotas maxDepth="256" maxStringContentLength="15728640" maxArrayLength="15728640" maxBytesPerRead="204800" maxNameTableCharCount="15728640" />
<security mode="None"></security>
</binding>
<binding name="LargeStrings" maxBufferPoolSize="524288" maxBufferSize="524288" maxReceivedMessageSize="524288">
<!-- 0.5MB max size -->
<readerQuotas maxDepth="256" maxStringContentLength="524288" maxArrayLength="524288" maxBytesPerRead="204800" maxNameTableCharCount="524288" />
<security mode="None"></security>
</binding>
</netTcpBinding>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我打电话LargeMessages,LargeFiles和LargeStrings"绑定配置".
现在我有了这个配置,我也可以有多个行为,其中一个可能看起来像这样:
<behavior name="DefaultServiceBehavior">
<serviceCredentials>
<serviceCertificate findValue="1234123412341234123412341234"
x509FindType="FindByThumbprint" />
</serviceCredentials>
<serviceMetadata/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,DefaultServiceBehavior是一种行为.
因此,提出问题的另一种方法是,为什么我的绑定配置不能包含我的行为指定的所有设置?或相反亦然?在基本和高级别,为什么我们有两套设置?这似乎都会对我的传输配置或我的消息配置产生很大影响.我只是没有看到设置分离的逻辑.
| 归档时间: |
|
| 查看次数: |
2458 次 |
| 最近记录: |