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.

Yan
  • 582
  • 2
  • 6
  • 22

1 Answers1

1

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
  • 2,226
  • 1
  • 14
  • 15
  • there I have variables - {name} {score} – Yan Sep 02 '10 at 16:58
  • 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 Sep 02 '10 at 17:03
  • is your url really works? are you on Apache or Tomcat or IIS? Do you have a logs to see them? – Eugene Sep 02 '10 at 17:08
  • 1
    can you show the output of your service via browser with that params u r using in flex. please. does it have `` string at a top. – Eugene Sep 02 '10 at 17:26
  • ok, I see it does not, return URL is completely different and I know what the problem is now, thnx! – Yan Sep 02 '10 at 17:40