inutan
inutan

Reputation: 10888

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 service.

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!

Upvotes: 1

Views: 909

Answers (1)

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364279

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.

Upvotes: 2

Related Questions