“默认解码器无法解码结果”

时间:2010-09-02 10:13:42

标签: flex mxml httpservice actionresult

以下是文件 -

MXML:

<mx:HTTPService id="score" url="http://...score.php" fault="mx.controls.Alert.show(event.fault.faultString)"
method="POST" result=""mx.controls.Alert.show(event.result.toString())">
            <s:request xmlns="">
                <name>{name}</name>
                <score>{score}</score>
            </s:request>
        </mx:HTTPService>

score.php

<?php

    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";

    $connections = mysql_connect("...");
    mysql_select_db("...");

    $name = $_POST['name'];
    $score = $_POST['score'];

    $query = "INSERT INTO hs (name, score) VALUES ('$name', '$score')"; 
    mysql_query($query);

?>

信息确实发送成功创建并执行上述查询。但“结果”事件给出“默认解码器无法解码结果”错误。

1 个答案:

答案 0 :(得分:1)

这段代码会对你说什么?

<mx:HTTPService id="scoreService" url="http://" method="POST" fault="mx.controls.Alert.show(event.fault.faultString)" result="mx.controls.Alert.show(event.result.toString())">
    <s:request xmlns="">
        <name>myName</name>
        <score>myScore</score>
    </s:request>
</mx:HTTPService>

您是否看到thisthis,您在客户端/服务器端有什么区别吗?