I'm having some trouble uploading a new document. My service receives a xml-document with Base64 content which it reads, converts and adds to a bytearrays which is read into a MemoryStream which is uploaded into EWS. I get a contextID back which indicates that the creation of the context is successfull, but when i try to use the contextID to upload the actual file i get the following errormessage "Error adding version to 'Test'" (Test is the name of my document).
The code which reads the bytes into the MemoryStream looks like this:
using (MemoryStream stream = new MemoryStream())
{
stream.Write(md.XML_File, 0, md.XML_File.Length);
stream.Flush();
objectID = UploadFile(stream, md.Token, contextID, md.ObjectName, md.XML_File.Length);
}
Can anybody explain why i keep getting this errormessage? I've doublechecked that the parentID is the folder where the document should be placed.