views:

35

answers:

1

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.

+1  A: 

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?

Eugene
“Default decoder could not decode result”
Yan
what about this?
Eugene
there I have variables - <name>{name}</name> <score>{score}</score>
Yan
The fact is that it does post data to my database. So it does perform what I need by inserting a row in the database...
Yan
is your url really works? are you on Apache or Tomcat or IIS? Do you have a logs to see them?
Eugene
It's MySQL (PHP - XML) and it does work.
Yan
can you show the output of your service via browser with that params u r using in flex. please. does it have `<?xml version="1.0" encoding="utf-8"?>` string at a top.
Eugene
ok, I see it does not, return URL is completely different and I know what the problem is now, thnx!
Yan
you are welcome, again =)
Eugene