C# maxReceivedMessageSize WCF
我使用WCF服务,但我有一个问题 传入邮件的最大邮件大小配额(65536)已被取消 超过。要增加配额,请使用MaxReceivedMessageSize 属性,该属性位于相应的绑定元素上 我修改了C# maxReceivedMessageSize WCF,c#,wcf,maxreceivedmessagesize,C#,Wcf,Maxreceivedmessagesize,我使用WCF服务,但我有一个问题 传入邮件的最大邮件大小配额(65536)已被取消 超过。要增加配额,请使用MaxReceivedMessageSize 属性,该属性位于相应的绑定元素上 我修改了MaxReceivedMessageSize,但没有结果(我在互联网上读了很多文章,但任何人都帮不上忙) 谁知道这件事 Service.config: <system.serviceModel> <bindings> <
MaxReceivedMessageSize
,但没有结果(我在互联网上读了很多文章,但任何人都帮不上忙)
谁知道这件事
Service.config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="BindingWithMaxSizeIncreased"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="FootballLife.MyService" behaviorConfiguration="metadataBehavior">
<endpoint
address=""
binding="wsHttpBinding" bindingConfiguration="BindingWithMaxSizeIncreased"
contract="FootballLife.IMyService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
Client.config
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="BindingWithMaxSizeIncreased"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint
address="http://localhost:90/MyService.svc"
binding="wsHttpBinding"
contract="IMyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
您需要在客户端配置中将自定义绑定配置提供给您的端点:
<endpoint address="http://localhost:90/MyService.svc"
binding="wsHttpBinding"
contract="IMyService"
bindingConfiguration="BindingWithMaxSizeIncreased">
<identity>
<dns value="localhost" />
</identity>
</endpoint>