I am calling Python script from flex using HTTP service. How can I send back some values from python to flex app?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using
HTTPService, many people will send back XML. Sometimes they’ll send back plain text. In your result handler, you should get the text returned from the service call as event.result.Your result handler may look something like this, if you were to return XML:
If you were to return plain text, it may look something like this:
The only time I’ve used the latter approach is if the return value is really simple, like a Boolean value (true or false). The only time I use XML is when I have no control over what the remote service returns. If at all possible I try to use an AMF Gateway; which will automatically translate server side objects into ActionScript objects.
I can assume that you know how to create a service in Python to output XML or text data.