1

DevForce 2010 と Silverlight 4 を使用しています。

大量のバイナリ データを含むエンティティを保存すると、次のエラーが発生します。

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

アプリケーションをデバッグすると、次のエラーが表示されます。

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

Bad CRC32 in GZIP stream.

この問題について議論している Ideablades フォーラムでこのスレッドを見つけました: http://www.ideablade.com/forum/forum_posts.asp?TID=3361&PN=1&title=bad-crc32-in-gzip-stream

これはサーバーまたはクライアントの問題ですか?

これは DevForce 2010 の新しいバージョンで解決された問題ですか?

私のサーバーには 4 GB のメモリがあります。メモリを増やすと問題は解決しますか?

または、正しい解決策は何ですか?

4

3 に答える 3

1

はい、クライアントとサーバーの両方の OnEndpointCreated オーバーライドは、カスタマイズを追加する必要がある場所です。以下を追加して、バインディングから GZIP を削除できます。

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 クライアントから EntityServer までのすべての圧縮がオフになるため、少し手間がかかる場合があります。IIS 圧縮をオンにして、クライアントに送信されるデータを圧縮して支援することができます。

于 2014-05-28T17:15:01.063 に答える
0

キム・ジョンソン、ありがとう。

私はサンプルを見てきましたが、それらの構成ファイルを追加して、今日はうまく機能するものを壊してしまうかもしれません。

コード通りに進めば、GZIP を無効にしても、DevForce の残りのデフォルト設定を保持できますか?

以下のコードは私がすべきものだと思いますか?

これらのクラスをクライアントとサーバーに保存すると、DevForce はこれらのクラスを自動的に見つけますか?

//Client

using System.ServiceModel.Channels;
using IdeaBlade.Core.Wcf.Extensions;

public class ProxyEvents  : IdeaBlade.EntityModel.ServiceProxyEvents {

  public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint) {
    base.OnEndpointCreated(endpoint);
    // My client code turning GZIP off comes here?
  }
  public override void OnFactoryCreated(System.ServiceModel.ChannelFactory factory) {
    base.OnFactoryCreated(factory);
  }
}

//Server
using System.ServiceModel.Channels;
using IdeaBlade.Core.Wcf.Extensions;

public class ServiceEvents : IdeaBlade.EntityModel.Server.ServiceHostEvents {

  public override void OnEndpointCreated(System.ServiceModel.Description.ServiceEndpoint endpoint) {
    base.OnEndpointCreated(endpoint);
    // My server code turning GZIP off comes here?
  }
  public override void OnServiceHostCreated(System.ServiceModel.ServiceHost host) {
    base.OnServiceHostCreated(host);
  }
}
于 2014-05-28T12:12:31.420 に答える
0

DevForce 2010 の 6.1.7 リリース以降、GZIP 処理に変更はありません。そのスレッドには、問題を回避する方法に関する最良の情報が含まれています。1) 保存ロジックまたはエンティティ定義を変更して、データが保存されました。2) GZIP の使用をオフにします。または 3) 別の圧縮ライブラリを使用してカスタム メッセージ エンコーダーを作成します。

于 2014-05-26T23:21:30.553 に答える