I am trying to delete a document from document library using lists.asmx.
I am calling this webservice from a webapplication as specified in one of the MSDN articles.
My code is as below.
// Create the xml command
string strBatch = "<Method ID='1' Cmd='Delete'>" +
"<Field Name='ID'>3</Field>" +
"<Field Name='FileRef'>" + relativeDocumentUrl + "</Field>" +
"</Method>";
XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlElement elBatch = xmlDoc.CreateElement("Batch");
elBatch.SetAttribute("OnError", "Continue");
elBatch.SetAttribute("PreCalc", "TRUE");
elBatch.SetAttribute("ViewName", System.Guid.NewGuid().ToString());
elBatch.InnerXml = strBatch;
// Executes the xml command batch
XmlNode xmlResult;
Lists spsLists = new Lists();
spsLists.Credentials = CredentialCache.DefaultNetworkCredentials;
xmlResult = spsLists.UpdateListItems(listName, batchCommand);
But I get the the following error. It doesn't have complete information as well.
System.Web.Services.Protocols.SoapException: Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown..
Can anyone help me out in solving this issue?