2014-11-03 2 views
0

데이터 소스 확장을 사용하여 여러 데이터베이스에 연결하는 IIS 7에 Silverlight 5 응용 프로그램을 배포했습니다. 우리는 예외은 "GZIP 스트림에 나쁜 CRC32"을 경험하고, 그래서 우리는 바인딩 바이너리 메시지와 함께 결합 GZIP을 교체하고 여기에 주어졌다 IIS 압축을 사용하는 조언을주의하기로 결정 Bad CRC32 in GZIP streamDevForce 구성에서 GZIP 끄기

을하지만 내가해야 내 web.config에 뭔가 빠져있다.

Cannot process the message because the content type 'application/x-gzip' was not the expected type 'application/soap+msbin1'. 

하는 내 응용 프로그램 EntityService.svc/SL와 통신을 시도 할 때 : 나는 binaryMessageEncoding으로 gzipMessageEncoding 노드를 교체 할 때, 나는 점점 시작했다.

IIS 관련 파일 (http://drc.ideablade.com/devforce-2012/bin/view/Documentation/code-sample-configuration-files)의 예제 web.config를 기반으로하는 내 web.config가 있습니다.
내가 잘못 뭐하는 거지

<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> 

?

답변

0

WCF 바인딩 정보는 클라이언트와 서버에서 동일해야하므로 Silverlight 클라이언트에서 ServiceReferences.ClientConfig 정보를 추가하거나 변경해야합니다. http://drc.ideablade.com/devforce-2012/bin/view/Documentation/code-sample-custom-client-servicemodel에 샘플이 있습니다.

+0

ServiceReferences.ClientConfig를 올바르게 설정하는 방법을 알지 못해 ServiceProxyEvents를 구현하고 OnEndpointCreated를 재정의했습니다. – Mitchell