Hi, I have an existing ASP.NET 2.0 site that has a new requirment for a
document repository with a roll out for early next year. WSS-3 seems like the
obvious choice to leverage, however I only want to use it on the back end.
In the following code, I am attempting to access the sharepoint site
programtically. The site is in the same virtual directory as the application
running.
SPGlobalAdmin objAdmin = new SPGlobalAdmin();
SPUser objUser = null;
foreach (SPVirtualServer objServer in objAdmin.VirtualServers)
{
if (objServer.Port ==
int.Parse(ConfigurationSettings.AppSettings["WSSPort"]))
{
foreach (SPSite objSite in objServer.Sites)
{
objUser = objSite.AllWebs[0].Users[userName];
break;
}
break;
}
}
return new SPSite(ConfigurationSettings.AppSettings["WSSUrl"],
objUser.UserToken).AllWebs[0];
objServer.Sites seems has length to it, but when I attempt to access any
site within it I get an exception in
Microsoft.SharePoint.Library.SPRequestInternalClass.GetTokenOfCurrentUser.
Any ideas on what I could possibly be doing wrong? I've added Everyone to my
local Administrators group so windows permissions should not be the issue.
What may be a related problem, the WSS WebServices are acessible from my
Central Administrator Site but not my Project Site (they are on different
virtual servers). When I try to access the web service on my project site I
get the html describing the service, but no WSDL.
Thank you for any assistance,
Jason Lind