如何通过<mx:httpservice>中的post方法将xml flex发送到php?</mx:httpservice>

时间:2009-07-09 10:31:59

标签: flex web-services air flash

我在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();

1 个答案:

答案 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']