Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying get Data of a list using GetListItems Method of Lists.asmx Here is my code:

XmlDocument objXMLDocument = null;

NetworkCredential credentials = new NetworkCredential("user", "pass", "domain");                

XmlNode resultXml = null;

try
{
    XElement result = null;
    string strResult = "<Result>";
    ListService.Lists objLists = new ListService.Lists();
    objLists.Url = "http://domain:port/_vti_bin/Lists.asmx";
    objLists.Credentials = credentials;
    objLists.proxy=new WebProxy();
    objXMLDocument = new XmlDocument();
    objXMLDocument.LoadXml("<QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns><Folder>" + "ListName" + "</Folder><ViewAttributes Scope=\"RecursiveAll\" /></QueryOptions>");
    XmlNode objQueryOptions = objXMLDocument.DocumentElement;
    resultXml = objLists.GetListItems("ListName", null, null, null, "100", objQueryOptions, null);
    XElement xresult = GetXElement(resultXml);
    XElement objXElement = xresult.Element(XName.Get("data", "urn:schemas-microsoft-com:rowset"));
    IEnumerable<XElement> objXElementList = (objXElement.Descendants(XName.Get("row", "#RowsetSchema")));

    strResult = strResult + "</Result>";
    result = XElement.Parse(strResult);
    return result;
}
catch (Exception ex) { return null; }

But it throws a Microsoft.sharepoint.soapexception and when I checked for details I got these errors:

List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user. 0x82000006

Error XML

<errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">
    List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user.
</errorstring>
<errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x82000006</errorcode>

Sharepoint server we are using is not in our network, it is in our clients network and we use VPN for development.

I feel like the error is can be due to proxy. In browser when i added the proxy provided by client I was able to access internet but not the sharepoint site, than I selected automatically detect proxy and site appeared.

Also i find this link with same error but not able to understand what is suggested solution is.http://www.sharepoint-answers.com/microsoft/SharePoint-Development/29848065/getlist-wss-list-does-not-exist.aspx

Please suggest what can i do. or is it feasible?

share|improve this question
    
What do you specify as ListName? It should be the GUID of the list. And I'd suggest removing the <Folder> element from QueryOptions –  Per Jakobsen Mar 29 '12 at 13:03
    
If it was the proxy you would probably get a 407 error. Since you're getting data back from the web services, you can connect OK. –  Kit Menke Mar 29 '12 at 13:25

1 Answer 1

up vote 4 down vote accepted

Does the list exists in the root of the site collection or in a sub site?

If the list is in the root than you can call it with: http://yourserver:port/_vti_bin/Lists.asmx

If the list you request is on a subsite you need to call the web service like this http://yourserver:port/SUBSITE/_vti_bin/Lists.asmx

share|improve this answer
    
+1 this is what my guess was too.. objLists.Url needs to reference the actual site where the list exists –  Kit Menke Mar 29 '12 at 13:27
    
Thanks it worked... –  Mohit Mar 30 '12 at 9:07
    
We are having a similar issue. A list with about 1200 items shows only 31 first items in a datasheet view with no Item Limit or Filter configured. ListData.svc renders all items, while Lists.asmx consistently limits to 31 and would not let you query for ID > 31 giving the same error as above. –  Alexey Krasheninnikov Feb 22 '13 at 9:01
    
As it seems, the problem arose after DPM restore of the list. –  Alexey Krasheninnikov Feb 22 '13 at 10:02
    
We had to do a delete/restore of the broken lists using a mix of Content Deployment Wizard to keep the GUIDs and web service based tools to restore the lists. –  Alexey Krasheninnikov Feb 27 '13 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.