I have added Web reference of the Lists service .
When I called GetListCollection() It worked perfectly fine but when I called GetListItems() , the SoapServerException is thrown.
Iam using below code:
client.Url = "http://Site/_vti_bin/Lists.asmx;"
client.Credentials = System.Net.CredentialCache.DefaultCredentials;
varlistData = client.GetListCollection();
try
{
/* Assign values to pass the GetListItems method*/
stringlistName ="{8ADCB879-2677-4FD4-BBA6-1C0B79A4B116}";
//string viewName = "AllItems";
stringrowLimit ="100"; // Instantiate an XmlDocument object
System.Xml.
XmlDocumentxmlDoc =newSystem.Xml.XmlDocument();
System.Xml.
XmlElementquery = xmlDoc.CreateElement("Query");
System.Xml.
XmlElementviewFields = xmlDoc.CreateElement("ViewFields");
System.Xml.
XmlElementqueryOptions = xmlDoc.CreateElement("QueryOptions"); /*Use CAML query*/
// query.InnerXml = "<Where><Gt><FieldRef Name=\"TWPage\" />" + "<Value Type=\"Text\">0</Value></Gt></Where>";
queryOptions.InnerXml =
"";
System.Xml.
XmlNodenodes = client.GetListItems("8ADCB879-2677-4FD4-BBA6-1C0B79A4B116",null, query, viewFields, rowLimit,null,null);
}
catch(System.Web.Services.Protocols.SoapExceptionex)
{
Console.WriteLine(ex.Message);
Console.ReadKey();
}
Please help