GZIP流中的CRC32错误 [英] Bad CRC32 in GZIP stream

查看:652
本文介绍了GZIP流中的CRC32错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DevForce 2010和Silverlight 4.

I am using DevForce 2010 and Silverlight 4.

保存包含大量二进制数据的实体时,出现此错误:

When saving entities that contain large amount of binary data, I get this error:

Unhandled Error in Silverlight Application The remote server returned an error: NotFound.

在调试应用程序时,我看到以下错误:

When debuging the application I see these errors:

Unhandled Error in Silverlight Application Insufficient memory to continue the execution of the program.

Bad CRC32 in GZIP stream.

我在Ideablades论坛上找到了讨论该问题的线程:

I found this thread on Ideablades forum that discusses the problem: http://www.ideablade.com/forum/forum_posts.asp?TID=3361&PN=1&title=bad-crc32-in-gzip-stream

这是服务器还是客户端上的问题?

Is this a problem on the server or client?

DevForce 2010的任何新版本中是否解决了这个问题?

Is this a problem that has been resolved in any new version of DevForce 2010?

我的服务器有4 GB内存.增加内存可以解决问题吗?

My server has 4 GB memory. Would increasing the memory resolve the problem?

或者什么是正确的解决方案?

Or what would be the right solution?

推荐答案

是的,应该在客户端和服务器上的OnEndpointCreated覆盖处添加自定义项.您可以添加以下内容以从绑定中删除GZIP:

Yes, the OnEndpointCreated overrides on both client and server are where you should add the customization. You can add the following to remove GZIP from the binding:

public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint)
{
    if (endpoint.Binding is CustomBinding)
    {
        var binding = endpoint.Binding as CustomBinding;
        var elements = binding.CreateBindingElements();

        // Swap out existing (GZIP) message encoding for binary
        var encoding = elements.Find<MessageEncodingBindingElement>();
        if (encoding != null)
        {
            elements.Remove(encoding);

            encoding = new BinaryMessageEncodingBindingElement();
            elements.Insert(0, encoding);
            endpoint.Binding = new CustomBinding(elements);
        }
    }
}

DevForce将在您的类在客户端/服务器上检测到的程序集中找到您的类.

DevForce will find your classes if they're in an assembly probed on the client/server.

这将关闭从DevForce客户端到EntityServer的所有内容的压缩,因此可能会有些费劲.您可以打开 IIS压缩来压缩数据发送给客户帮助.

This will turn off compression for everything from your DevForce client to the EntityServer, so may be a bit heavy-handed. You can turn on IIS compression to compress data sent to the client to help.

这篇关于GZIP流中的CRC32错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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