你的位置:首页 > 软件开发 > ASP.net > 关于WCF SessionId的说明

关于WCF SessionId的说明

发布时间:2015-07-14 12:00:27
在WCF中,会话(Session)是服务端获取客户端会话信息的一种机制,本文描述了会话存在的前提条件和范围,以及具体操作。 一、会话前提条件 WCF中存在会话的前提条件有: 1、契约属性SessionMode ...

    在WCF中,会话(Session)是服务端获取客户端会话信息的一种机制,本文描述了会话存在的前提条件和范围,以及具体操作。

    一、会话前提条件

    WCF中存在会话的前提条件有:

    1、契约属性SessionMode

    契约协定中的SessionMode必须为Allowed(默认)或Required,代码示例如下:

关于WCF SessionId的说明关于WCF SessionId的说明
using System.ServiceModel;namespace SessionIdTest{  // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IHello" in both code and config file together.  [ServiceContract(SessionMode = SessionMode.Required)]  public interface IHello  {    [OperationContract]    void Login(string name);    [OperationContract]    string Say(string content);    [OperationContract]    void Test();  }}

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:关于WCF SessionId的说明

关键词:session

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录