Please help if you can.
I have been trying to access the current session object of an asp.net application from within a WCF REST service.
There has been no success at all. the session object accessed from the service is not the same one in the aspx pages.
So, here is my question: Is it possible to access the current session in a REST WCF service through HttpContext.Current.Session ?
The code has the following points:
[AspNetCompatibilityRequirements
(RequirementsMode =
AspNetCompatibilityRequirementsMode.Allowed)] // I have also tried Required
public class DataService : IDataService
in web.config:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="ClosedRoom.DataServiceBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" >
<baseAddressPrefixFilters>
<add prefix="http://localhost:63399"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<services>
<service name="ClosedRoom.DataService">
<endpoint address="" behaviorConfiguration="ClosedRoom.DataServiceBehavior"
binding="webHttpBinding" contract="ClosedRoom.IDataService" />
</service>
</services>
</system.serviceModel>
Thank you,