我正在构建一个与简单 php 服务通信的 flex 移动应用程序。这是 flex 客户端代码:
<s:Label text="{myRemote.lastResult}" x="50" y="50" />
<s:Button label="invoke" x="100" y="50" click="myRemote.send()" />
<fx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent ;
protected function firstScript_faultHandler(event:FaultEvent):void{
trace("ERROR HANDLED");
}
]]>
</fx:Script>
<s:RemoteObject id="myRemote" source="firstScript"
endpoint="http://localhost/firstScript"
fault="firstScript_faultHandler(event)" />
这是保存在 wamp 文件夹的 www 文件夹中的 php 脚本:
<?php
class firstScript{
function check(){
return "abcd" ;
}
}
?>
我在数据/服务选项卡中设置了返回类型和与服务相关的所有内容,但我没有得到 php 服务的响应。有人可以帮我吗?