Based on the Solution presented here for the err msg I'm getting ("Data at the root level is invalid. Line 1, position 1") - much more about my travails are documented here, I tried changing my server code from this:
public async void SendInventoryXML(String userId, String pwd, String fileName)
{
XDocument doc = XDocument.Load(await Request.Content.ReadAsStreamAsync());
String saveLoc = String.Format(@"C:\HDP\{0}.xml", fileName);
doc.Save(saveLoc);
}
...to this:
public async void SendInventoryXML(String userId, String pwd, String fileName)
{
MemoryStream ms = new MemoryStream(await Request.Content.ReadAsStreamAsync());
ms.Flush();
ms.Position = 0;
XDocument doc = XDocument.Load(ms);
String saveLoc = String.Format(@"C:\HDP\{0}.xml", fileName);
doc.Save(saveLoc);
}
...but get, "Argument 1: cannot convert from 'System.IO.Stream' to 'int'" and "The best overloaded method match for 'System.IO.MemoryStream.MemoryStream(int)' has some invalid arguments"
Why would a MemoryStream expect an int as an arg? Doesn't / shouldn't it really want an array of bytes or something like that?