I have created and deployed a WCF service in SharePoint and I am sending requests using JQuery. Every thing is working fine except for sub sites.
Lets say I have these two service URLs:
- http://localhost:1111/_vti_bin...../MethodName
- http://localhost:1111/subsite/_vti_bin...../MethodName
When I use these two URLs the SPContext.Current.Site is the same and is correct.
But the SPContext.Current.Web is the same which is incorrect. Using the second URL the SPWeb object must be the sub web and not the root web.
How can I get the sub site as an SPWeb object? Do I need to always pass the web URL as a parameter to the WCF method?