views:

25

answers:

1
+1  Q: 

HHTTPService Error

I'm trying to debug an issue by going to the most basic of tasks.

I have an app written in adobe flex (action script 3) that I want to have interact with a web service. Because it appears I can't access the server, I've created a simple app.

Source code for the ActionScript

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" viewSourceURL="srcview/index.html">
    <mx:HTTPService id="concat" url="concat.php" resultFormat="text" method="POST">
        <mx:request xmlns="">
            <stringOne>{stringOne.text}</stringOne>
            <stringTwo>{stringTwo.text}</stringTwo>
        </mx:request>
    </mx:HTTPService>

    <mx:VBox top="10" left="10">
        <mx:HBox verticalAlign="middle">
            <mx:Label text="String 1:"/>
            <mx:TextInput id="stringOne"/>
        </mx:HBox>
        <mx:HBox verticalAlign="middle">
            <mx:Label text="String 2:"/>
            <mx:TextInput id="stringTwo"/>
        </mx:HBox>
        <mx:HRule width="100%"/>
        <mx:Button label="Concatenate!" click="concat.send()"/>
        <mx:Text fontSize="14" text="{concat.lastResult}"/>
    </mx:VBox>

</mx:Application>

Code for the PHP

<?php

$stringOne = $_POST['stringOne'];
$stringTwo = $_POST['stringTwo'];

print $stringOne . $stringTwo;

?>

When I fill in the fields and press the button nothing happens. Ideas? Thoughts? Suggestions?

+1  A: 

try this one and let us know:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" viewSourceURL="srcview/index.html">
    <mx:HTTPService id="concat" url="concat.php" resultFormat="text" method="POST" fault="mx.controls.Alert.show(event.fault.faultString)" result="mx.controls.Alert.show(event.result.toString())">
        <mx:request xmlns="">
            <stringOne>{stringOne.text}</stringOne>
            <stringTwo>{stringTwo.text}</stringTwo>
        </mx:request>
    </mx:HTTPService>

    <mx:VBox top="10" left="10">
        <mx:HBox verticalAlign="middle">
            <mx:Label text="String 1:"/>
            <mx:TextInput id="stringOne"/>
        </mx:HBox>
        <mx:HBox verticalAlign="middle">
            <mx:Label text="String 2:"/>
            <mx:TextInput id="stringTwo"/>
        </mx:HBox>
        <mx:HRule width="100%"/>
        <mx:Button label="Concatenate!" click="concat.send()"/>
        <mx:Text fontSize="14" text="{concat.lastResult}"/>
    </mx:VBox>

</mx:Application>
Eugene
You just want to see if it errors I guess and get the stack. I'll try it
PSU_Kardi
yeah, just in case to continue client side testing, we should all events of HTTPService, so we could determine the place and reason of errors and exceptions. Regards Eugene
Eugene
i see you accepted it, would you like to share the solution of your side :) thanks.
Eugene