ds42774 2010-04-24 17:17
浏览 30

调试中的Flex服务

I am trying to learn the new services method in flex 4. but i can´t get it work. A test oparation near the service in flash builder 4 works. But when i run the code i get NetConnection.Call.Failed: HTTP: Failed. Does somebody knows what the problem can be?

Tom

CODE:

PHP

 <?php 

class AuthService {
    public function login($username, $password) {
        return 'ok';
    }
    public function logout() {
        return true;
    }
}

?>

FLEX

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" xmlns:authservice="services.authservice.*">
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;

            protected function button_clickHandler(event:MouseEvent):void
            {
                loginResult.token = authService.login(username, password);
            }

        ]]>
    </fx:Script>
    <fx:Declarations>
        <s:CallResponder id="loginResult"/>
        <authservice:AuthService id="authService" fault="Alert.show(event.fault.faultString + '
' + event.fault.faultDetail)" showBusyCursor="true"/>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Button x="97" y="193" label="Button" id="button" click="button_clickHandler(event)"/>
    <s:TextInput x="91" y="87" id="username"/>
    <s:TextInput x="97" y="117" id="password"/>
</s:Application

>

  • 写回答

1条回答 默认 最新

  • doubu1970 2010-04-24 22:38
    关注

    Checkout your crossdoamin settings on the php server side.

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?