I have been trying to find out the issue faced for some documents while uploading in libraries using list.asmx service in web application.
The steps i follow:
- Uploads document using copy service.
- Update uploaded document properties.
I am facing issue for some documents while updating their properties. I don't know whether it is document size or document type which is causing problem.
If i say it is document size or type, it might be wrong as i have uploaded similar document with same type and larger size with no exception.
Following the code i am using to update document's properties.
XmlDocument doc = new XmlDocument();
XmlElement batch = doc.CreateElement("Batch");
batch.SetAttribute("OnError", "Continue");
batch.SetAttribute("ListVersion", "1");
batch.SetAttribute("ViewName", viewname);
batch.InnerXml = "<Method ID='1' Cmd='Update'>" +
"<Field Name='ID'>" + id + "</Field>" +
"<Field Name='" + columnName + "'>" + colValue + "</Field></Method>";
XElement xElement = Utility.ToXElement(batch);
//ListsSoapClient object
var proxy = Utility.GetServerListProxy();
proxy.UpdateListItems(listname, xElement);
Exception is
Fault exception details:
Cannot access a closed Stream.
Thanks in advance.
using
statements for aStream
class inside each other and the outerusing
statement is still trying to use the variable from the secondusing
statement.