关于WCF Session,InstanceContextMode,ConcurrencyMode等的基本查询很少

时间:2013-01-01 19:09:07

标签: wcf

我是WCF的新手。经常注视wcf代码&文章。看完很多代码之后我 经常坚持非常基本的事情,并没有对下面的问题进行详细的讨论。 所以这里是我的几个基本问​​题....并寻找详细讨论样本情况和示例代码。

问题A

if we do not write anything like SessionMode=SessionMode.Required 
then what will be default nature of WCF service. there will be no session

a) SessionMode.Required
b) SessionMode.Allowed
c) SessionMode.NotAllowed

只是简单地告诉我SessionMode.Required,SessionMode.Allowed是什么意思 SessionMode.Required,SessionMode.Allowed?

之间有什么区别?

什么是默认会话模式?

我见过人们开发wcf服务,但没有指定像session这样的东西。所以,只要告诉我什么时候应该打开SessionMode.Required或SessionMode.Allowed?

问题B

what is InstanceContextMode? 
many people use InstanceContextMode Single or PerCall or PerSession ?

我只需要深入了解我应该去InstanceContextMode Single或 或PerCall或PerSession?

简要告诉我,当我打开单身时会发生什么事情或者PerCall或PerSession会发生什么? Single或PerCall或PerSession之间有什么区别

什么是默认的InstanceContextMode?

问题C

what is ConcurrencyMode ??
actually what ConcurrencyMode  does.....what it determines??
there are few ConcurrencyMode available and those 
are Multiple,Reentrant and Single

which concurrent mode one should use in what kind of situation. 
what will be the best    choice

问题D

what is the meaning of UseSynchronizationContext=false 
when one should turn on UseSynchronizationContext=true 
or when one should go for UseSynchronizationContext=false ?

问题E

关于operationcontract

[OperationContract(IsInitiating=false, IsOneWay=false)]
bool Add_Contact(int sessionkey, string Newusrname);

IsInitiating = false或true的含义是什么?什么时候我应该设置它是真还是假? IsOneWay = false或true的含义是什么?什么时候我应该设置为真还是假?

我相信我的问题是非常基本的,每次监控这个论坛都有很多学者。 我希望我会在很多情况下得到最好的答案,例如当一个人应该选择哪个选项而不是其他选项时,几乎没有用于模拟情境的示例代码。 感谢

1 个答案:

答案 0 :(得分:0)

检查此link是否在WCF中使用会话,将回答您的A和E

休息将被回答here

相关问题