首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在DevForce Config中关闭GZIP

在DevForce Config中关闭GZIP
EN

Stack Overflow用户
提问于 2014-11-03 18:13:29
回答 1查看 95关注 0票数 0

我有一个Silverlight 5应用程序部署在IIS 7中,使用数据源扩展连接到多个数据库。我们一直在经历“GZIP流中的坏CRC32”异常,因此我们决定听取以下建议,将GZIP绑定替换为二进制消息绑定,并使用IIS压缩,如下所示:Bad CRC32 in GZIP stream

但我一定是在web.config里漏掉了什么。当我将gzipMessageEncoding节点替换为binaryMessageEncoding时,我开始获得:

代码语言:javascript
复制
Cannot process the message because the content type 'application/x-gzip' was not the expected type 'application/soap+msbin1'.

当我的应用程序试图与EntityService.svc/sl通信时。

下面是我的web.config,我基于http://drc.ideablade.com/devforce-2012/bin/view/Documentation/code-sample-configuration-files上与IIS相关的文件中的示例web.config。

代码语言:javascript
复制
  <ideablade.configuration version="6.00" xmlns="http://schemas.ideablade.com/2010/IdeaBladeConfig">
    <logging logFile="log/sl.xml" archiveLogs="true" />
    <objectServer>
      <serverSettings supportedClientApplicationType="Silverlight"/>
    </objectServer>
  </ideablade.configuration>

  <system.serviceModel>
  <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="false" />

    <services>
      <service name="EntityService">
        <endpoint address="sl" binding="customBinding" bindingConfiguration="customBinaryBindingHttp" contract="IdeaBlade.EntityModel.Server.IEntityServiceContract" />
      </service>
      <service name="IdeaBlade.EntityModel.Server.EntityServer">
        <endpoint address="sl" binding="customBinding" bindingConfiguration="customBinaryBindingHttp" contract="IdeaBlade.EntityModel.Server.IEntityServerContract" />
      </service>
    </services>

    <bindings>
      <customBinding>
        <binding name="customBinaryBindingHttp" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" >
          <binaryMessageEncoding>
            <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" />
          </binaryMessageEncoding>
          <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
        </binding>
      </customBinding>
    </bindings>
  </system.serviceModel>

  <system.web>
    <httpRuntime maxRequestLength="1048576" executionTimeout="1200" targetFramework="4.5.1" />
    <compilation debug="false" targetFramework="4.5.1" />
    <customErrors mode="RemoteOnly" defaultRedirect="error.htm" />
  </system.web>

  <connectionStrings>
    <add name="MyEntities_1234" connectionString="XXX" providerName="System.Data.EntityClient" />
    <add name="MyEntities_5678" connectionString="XXX" providerName="System.Data.EntityClient" />
  </connectionStrings>

  <system.webServer>
    <defaultDocument>
      <files>
        <clear />
        <add value="default.aspx" />
        <add value="index.html" />
        <add value="Default.htm" />
        <add value="Default.asp" />
        <add value="index.htm" />
        <add value="iisstart.htm" />
      </files>
    </defaultDocument>
    <modules>
      <add name="ErrorHandlerModule" type="System.Web.Mobile.ErrorHandlerModule, System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="managedHandler" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>

</configuration>

我做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2014-11-04 01:05:24

WCF绑定信息在客户机和服务器上都需要相同,因此您还需要在Silverlight客户机上添加或更改ServiceReferences.ClientConfig信息。在http://drc.ideablade.com/devforce-2012/bin/view/Documentation/code-sample-custom-client-servicemodel有一个样本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26720360

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档