开发者

WCF Session - ASP.Net Session

I have WCF service using netTcpBinding (so default InstanceContextMode=PerSession).

Service is being called from ASP.Net Web Application using code similar to:

ServiceClient service = new ServiceClient();
service.ServiceMethod1();
service.Close();

So, we create a proxy instance here - call the required method and - close the ser开发者_如何学Cvice.

Query -

When do we say that a WCF Session is created?

Is it correspond to one ASP.Net Session... so suppose one user having an ASP.Net Session, whatever calls this user will make to service from his session will also mean a WCF session?

Thank you!


When do we say that a WCF Session is created?

When you first call the service from a new proxy instance.

Is it correspond to one ASP.Net Session... so suppose one user having an ASP.Net Session, whatever calls this user will make to service from his session will also mean a WCF session?

No. WCF session doesn't work in the same way as ASP.NET session. WCF session is with out of the box implementation maintained per proxy. Once you close your service client the session is gone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜