同步大数据,服务器返回404消息 [英] Syncing large data, server returns 404 message

查看:70
本文介绍了同步大数据,服务器返回404消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试使用同步框架4将Silverlight应用程序中的一些图片同步到sql server数据库。当我第一次尝试同步2张图片(~20MB邮件正文)时,一切正常我碰到最多3张图片(~30MB消息
正文)我的服务器在UploadChanges请求上返回404消息。这不是"未找到错误",使用fiddler,返回的消息是我服务器的实际404错误。知道为什么会这样吗?不确定是否重要,但我正在使用SSL。以下是我的
客户端/服务器端点配置:

Hello, I'm trying to sync some pictures from a silverlight application to an sql server database using sync framework 4. Everything works fine when I first tried the sync 2 pictures at once (~20MB message body) when I bump that up to 3 pictures (~30MB message body) my server returns a 404 message on the UploadChanges request. This is not a "Not Found Error," using fiddler, the message returned is my server's actual 404 error. Any idea why this is happening? Not sure if it matters but I'm using SSL. Below are my Client/Server endpoint configs:

客户端:

        <bindings>
            <basichttpbinding>
                <binding maxbuffersize="2147483647" maxreceivedmessagesize="2147483647" name="BasicHttpBinding_Idb5DNWCFService" transfermode="StreamedResponse">
                    <security mode="TransportWithMessageCredential"></security>
                </binding>
            </basichttpbinding>
        </bindings>
        <client>
            <endpoint address="https://localhost/5DNtest/Services/db5DNWCFService.svc" binding="basicHttpBinding" bindingconfiguration="BasicHttpBinding_Idb5DNWCFService" contract="db5DNService.Idb5DNWCFService" name="BasicHttpBinding_Idb5DNWCFService"></endpoint>
        </client>

服务器:

    <bindings>
      <webhttpbinding>
        
        <binding maxbufferpoolsize="5242880" maxreceivedmessagesize="2147483647" name="higherMessageSize" transfermode="Streamed">
          <readerquotas maxarraylength="2147483647" maxbytesperread="4096" maxdepth="32" maxnametablecharcount="16384" maxstringcontentlength="2147483647"></readerquotas>
          <security mode="Transport">
            <transport clientcredentialtype="None"></transport>
          </security>
        </binding>
      </webhttpbinding>
    </bindings>
    <services>
      <service name="DefaultScope.DefaultScopeSyncService">
        <endpoint address="" binding="webHttpBinding" bindingconfiguration="higherMessageSize" contract="Microsoft.Synchronization.Services.IRequestHandler"></endpoint>
      </service>
   </services>

推荐答案

我刚刚想通了。显然,无论您在绑定中设置了什么,IIS默认最大邮件大小为30MB。 Microsoft *真的*应该有更好的错误消息然后返回Web服务器的404页面,这太荒谬了!我将
添加到web.config并且它可以正常工作:

Well I just figured it out. Apparently IIS defaults to a maximum message size of 30MB no matter what you have set in your bindings. Microsoft *really* should have a better error message then returning the web server's 404 page, that is ridiculous! I added this to the web.config and it works okay:

  <system.webServer>
    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="524288000"/>
      </requestFiltering>
    </security>
    <validation validateIntegratedModeConfiguration="false" />
    <asp>
      <limits maxRequestEntityAllowed="2147483647" bufferingLimit="2147483647" />
    </asp>
  </system.webServer>


这篇关于同步大数据,服务器返回404消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆