i have code in flash (as3):
function xacnhanclick(evt:Event):void
{
var bookedXML:XML=<data/>;
for(var i:uint=0;i<hang;i++)
{
for(var j:uint=0;j<cot;j++)
{
if(ghearray[i][j]._check==1)
{
bookedXML.data+=
<ghe>
<maghe>{i + '' + j}</maghe>
<hangindex>{i}</hangindex>
<cotindex>{j}</cotindex>
</ghe>;
//trace(i+" "+j);
}
}
}
sendxml(bookedXML);
}
public function sendxml(xml:XML):void
{
var req:URLRequest = new URLRequest("Chonphong.aspx");
req.method = URLRequestMethod.POST;
req.contentType = "text/xml";
req.data = "<?xml version='1.0' encoding='utf-8' ?>\n" + xml;
sendToURL(req);
trace(req.data);
}
and i try to get xml data in aspx, but but it has an error: "Data at the root level is invalid. Line 1, position 1." i've checked the format of xml data in flash. it's correct. please help me
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.PreserveWhitespace = true;
myXmlDoc.Load(Request.InputStream);
Response.Write(myXmlDoc.InnerXml);