WCF绑定我不明白什么是错的
本文关键字:什么 明白 绑定 WCF | 更新日期: 2023-09-27 18:09:44
我在vs 2013开始编写这个。我有两个端点(除了Mex)——然后我想为最后一个端点下载更多的数据。所以-我添加到我的配置-我自己的http绑定> BHBinding(抱歉的鞭打)2147483647到处-但我的客户端似乎得到旧的错误65536不够大。"已超过传入消息的最大消息大小配额(65536)。"
我没有过多地使用WCF -但在过去能够让它工作,不确定我没有看到或理解什么。谢谢你的问候。
下面是我的配置:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BHBinding" allowCookies="true" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="FTPServiceLibrary.FTPService">
<endpoint address="" binding="basicHttpBinding" bindingName=""
contract="FTPServiceLibrary.IFTPError">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<endpoint address="/FTPSettingAddress" binding="basicHttpBinding"
bindingConfiguration="BHBinding" bindingName="" contract="FTPServiceLibrary.IFTPSetting" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8733/Design_Time_Addresses/FTPServiceLibrary/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
感谢Tung给我指出了正确的方向——我现在不仅要进一步了解服务器端,还要了解服务器端和客户端如何有不同的需求。以下是我更新后的客户端:
<bindings>
<basicHttpBinding>
<!--<binding name="BHBinding_IFTPSetting" />-->
<binding name="BHBinding_IFTPSetting" allowCookies="true" maxBufferPoolSize="2147483647"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" >
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://server.company.com/EI.SecureFTP/FTPServiceLibrary.FTPService.svc/FTPSettingAddress"
binding="basicHttpBinding" bindingConfiguration="BHBinding_IFTPSetting"
contract="ftpservice.IFTPSetting" name="BHBinding_IFTPSetting" />
</client>