Hello,
I have a sharepoint site that hold a very large list (more than 5000 items).
I was thinking of exposing a web service that eill return a list of guids.
I have a class that returns said list and I am trying to instantiate the class from the web service.
If I try to implment the class that returns the list of guid in an console application, everything works and I get the list of guids.
However, if i try to instantiate the class from a web service, when trying to open the site collection:
using (SPSite site = new SPSite(strSite))
I am getting an error
System.IO.FileNotFoundException: The Web application at http://npebwebstream could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.
Does anyone have an idea how to overcome this problem?
Here is the code
public void ProcessLargeList()
{
ContentIterator iterator = new ContentIterator();
using (var oSite = new SPSite(Site))
{
using (SPWeb oWeb = strWeb.Length > 0
? oSite.OpenWeb(Web)
: oSite.RootWeb)
{
SPList spDoc = oWeb.Lists[DocumentLibrary] as SPDocumentLibrary;
if (Query != null && Query.Length > 0)
{
SPQuery spquery = new SPQuery();
spquery.Query = Query;
spquery.QueryThrottleMode = SPQueryThrottleOption.Override;
Status = IterationStatus.Started;
iterator.ProcessListItems(spDoc, spquery, ProcessListItem,
ProcessListItemError);
}
else
{
iterator.ProcessListItems(spDoc, ProcessListItem,
ProcessListItemError);
}
Status = IterationStatus.Completed;
}
}
}
Thanks in advance,
Yossi