Search code examples
apache-flexmxmlhttpserviceactionresult

"Default decoder could not decode result"


Here are the files -

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);

?>

Information does sends successfully creating and doing the query above. But "result" event gives "Default decoder could not decode result" error.


Solution

  • what will say this code for you?

    <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>
    

    did you see this and this, do you have some difference in client/server side?