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?