views:

554

answers:

2

I have two WCF services configured with ASP.NET compatible mode to allow them to use ASP.NET session state. The problem is as follows:

1.- A call to the first service stores a value in the ASP.NET session state. 2.- A second call to the first service can read that value.

but...

3.- A call to the second service can't read the ASP.NET session state value.

It seems that the ASP.NET session state is not shared between the two WCF services.

Is there a way to share ASP.NET Session state between two WCF Services?

A: 

If the 2 services share the database you can implement your session storage there. You would be able in to share information among different services or apps.

Claudio Redi
Thank you very much.How can I do that?The problem is that the session state is different for each pair of callers.For example, two consumer machines exist running a program that call the two services. The session state must be different for each consumer machine.
Moreno
The basic idea is to store in the database any infornation that you need to share among services. Supposing that the database is a storage resource common for all.You should create a table SharedSession or something like that and use it for write / read session state that needs to be shared.
Claudio Redi
A: 

The two calls will generate two different sessions, so the answer is kinda no. You may need to find some custom way to handle this.

In general, service calls should be atomic and shouldn't be relying on the session in this way - if you can make it so that session is not used at all, then this is the best solution.

Paddy
Thank you for yor response.The scenario is:We have different services: CRM, Financials, Fabrication... (all use the same Database).To use these services the client must LogIn in the system to verify the credentials and to extract info such as the language, runtime parameters, authorization rules and so on; that info is stored in the session state (the log in process can be slow).The idea was to provide another service to expose a LogIn operation, so other services don't be forced to LogIn each time.I will appreciate any ideas. Than you in advance.
Moreno