1

WCF サービス (webHttp) でセッションを使用しようとしていますが、セッションが要求間で一貫していません (サービスへの 2 番目の呼び出しを行うと、セッションは NULL ではありませんが、挿入したキーは存在せず、セッションはIDは異なります)。

私がチェックしたところ、デフォルトの InstanceContextMode は PerSession であり、これは私の要件に適していると理解しています。

WCF でセッションを使用するために必要なその他の構成はありますか?

ありがとう!

4

1 に答える 1

3

You need to use a binding that supports reliable sessions, such as these:

  • HTTP-based transport standard bindings:

    WsHttpBinding and expose request-reply or one-way contracts.

    Can be used when using reliable session over a request-reply or simple one-way service contract.

    WsDualHttpBinding and expose duplex, request-reply, or one-way contracts.

    WsFederationHttpBinding and expose request-reply or one-way contracts.

  • TCP-based transport standard bindings:

    NetTcpBinding and expose duplex, request reply, or one-way contracts.

Look here for more info: http://msdn.microsoft.com/en-us/library/ms733136.aspx

于 2012-08-02T13:28:43.850 に答える