最大邮件大小配额传入消息

最大邮件大小配额传入消息

本文介绍了最大邮件大小配额传入消息(65536)已超过的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WCF服务的以下配置。

尽管我已经增加了maxReceivedMessageSize,服务仍引发一个错误:

这又如何解决呢?

 < system.serviceModel>
    <服务>
      <服务名称=为MyServicebehaviorConfiguration =MyServiceTypeBehaviors>
        <端点地址=HTTP://本地主机:22230 / MyService.svc
              绑定=basicHttpBinding的
              bindingConfiguration =MyServiceBinding
              合同=IMyService/>

        <终点合同=IMetadataExchange接口绑定=mexHttpBinding地址=MEX/>
      < /服务>
    < /服务>

    <行为>
      < serviceBehaviors>
        <行为NAME =MyServiceTypeBehaviors>
          < serviceMetadata httpGetEnabled =真/>
        < /行为>
      < / serviceBehaviors>
    < /行为>

    <绑定>
      < basicHttpBinding的>
        <绑定名称=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 =缓冲
               messageEncoding =文本
               textEncoding =UTF-8
               bypassProxyOnLocal =假
               useDefaultWebProxy =真正的>
          <安全模式=无/>
        < /装订>
      < / basicHttpBinding的>
    < /绑定>
  < /system.serviceModel
 

解决方案

如果是这种服务的配置,你应该看看你的客户端配置,并符合maxReceivedMessageSize到服务器的邮件大小。该消息是从客户端来了。

I have the following configuration for a WCF service.

Even though I have increased the maxReceivedMessageSize , service still throws an error:

How can this be solved?

  <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
解决方案

If this is the service config, you should look in your client config and match the maxReceivedMessageSize to the servers message size. The message is coming from your client.

这篇关于最大邮件大小配额传入消息(65536)已超过的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 06:14