I do RPC using HttpService.
In my situation, I need to send results from Java code to
Flex Action script. I have defined a Java Servlet receiving data
from Flex application, then it processes with the data, finally the
Servlet is supposed to send some feedbacks to the client(Flex).
My question is that how can I define codes in doPost() method
that the following function will get "result" from the Java side.
public static function httpResult(event:ResultEvent):void
var result:Object = event.result;
//Do something with the result.
if (result.toString() == "success")
resultMessage.text = "Login Success";
resultMessage.text = "Invalid User";
Try this: If you are sending a simple text as "sucess" or
"error" after doing some process in the servlet..
set your content type to "text/plain" and simply
println(<data to be sent>);
In the flex application, get the result text that the servlet
resultString = String(httpUrl.lastResult);
where httpUrl is the id of the HTTPService. Now you can
compare what the servlet send by:
Hope this solves your problem :)
-- Abdel Olakara