我在flex创建后创建了xml,我通过http服务发布到php但是当我在http服务中添加xml时,flex会抛出错误消息,如错误#1096:XML解析器失败:未终止元素。“ 我做了什么?如何将xml数据flex发送到php?请告诉我
<mx:HTTPService id="createxml" method="POST" url="http://####/admin/?do=storebettingdetails" useProxy="false"></mx:HTTPService>var xm:XML = new XML("**********"); ------ adding child node -- Thend attached xml to service like createxml.request=xm;
createxml.send();
答案 0 :(得分:2)
在脚本中创建xml变量
[Bindable]
private var xml : XML = new XML("xml code");
并在mxml中,在httpservice组件上make:
<mx:HTTPService id="createxml"
method="post"
url="http://....../?do=storebettingdetails">
<mx:request>
<myxml>{this.xml}</myxml>
</mx:request>
</mx:HTTPService>
你将获得php中的xml为$ _POST ['myxml']