我对WCF服务有以下配置。传入邮件的最大邮件大小限额(65536)已被超出
即使我增加了maxReceivedMessageSize,服务还是抛出一个错误:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.`" exception.
这又如何解决呢?
<system.serviceModel>
<services>
<service name="MyService" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint address="http://localhost:22230/MyService.svc"
binding="basicHttpBinding"
bindingConfiguration="MyServiceBinding"
contract="IMyService" />
<endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="MyServiceBinding"
hostNameComparisonMode="StrongWildcard"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
openTimeout="00:10:00"
closeTimeout="00:10:00"
maxReceivedMessageSize="6553600"
maxBufferSize="6553600"
maxBufferPoolSize="524288"
transferMode="Buffered"
messageEncoding="Text"
textEncoding="utf-8"
bypassProxyOnLocal="false"
useDefaultWebProxy="true" >
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel
我的理论是,你的客户端配置不正确配置。 – ChaosPandion
所以你说,这是正确的,应该工作?我的客户现在是WCFTestClient。 – DarthVader
在[此线程](http://social.msdn.microsoft.com/forums/en-US/wcf/thread/f1ad96bf-c5a0-4e6f-a357-0957d32cf2e5)中有一些想法,其中一些不适用不适用(例如,你已经增加了maxBufferSize),但可能更值得仔细观察。 – ewall