本文介绍了WCF MaxReceivedMessageSize属性不接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有运气搜索...

我一直在获取

这很有意义,因此我同时介绍了Server和Client配置并进行更改:

It makes sense, so I go into both Server and client config and make the change:

Client

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IFileUpload"
           closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transferMode="Streamed" messageEncoding="Text" maxBufferSize="65536" maxReceivedMessageSize="67108864">
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost/services/FileUpload.svc"
          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
          contract="CFTW.FileUpload.IFileUpload" name="BasicHttpBinding_IFileUpload" />
    </client>
  </system.serviceModel>

服务器

    <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IFileUpload"

                 transferMode="Streamed" messageEncoding="Text" maxBufferSize="67108864" maxBufferPoolSize="67108864" maxReceivedMessageSize="67108864">

        </binding>
      </basicHttpBinding>

    </bindings>
    <services>
      <service name="BasicHttpBinding_IFileUpload">
        <endpoint address="~/services/FileUpload.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileUpload"
            contract="CFTW.FileUpload.IFileUpload"></endpoint>
      </service>

    </services>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

我不确定为什么它不起作用(否则我会解决它:))。它在.NET 4.0 RC上运行。

I'm not sure why it's not working (otherwise I'd fix it:)). It's running on .NET 4.0 RC.

推荐答案

我只是遇到了这个问题。我发现我的自定义绑定根本没有应用。然后,我在绑定标记中使用了 name = 。然后,一切都开始使用新设置。这是由于.NET 4.0带有默认的绑定/端点/行为配置。这些默认设置的 name = 。我只是修改了默认绑定本身。无法应用我的自定义绑定(命名)的原因是由于< service> 标记中的名称值。它应该跟随< Namespace.ServiceClassName>

I just ran into this issue. I found that my custom binding did not get applied at all. Then I used name = "" in binding tag. Then everything started working with the new settings. This is due to .NET 4.0 comes with default binding/endpoint/behavior configurations. These default settings have name = "". I just modified the default binding itself. The reason for my custom binding(named) did not get applied is due to the value for the name in <service> tag. It should follow <Namespace.ServiceClassName>.

这篇关于WCF MaxReceivedMessageSize属性不接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 22:27
查看更多