Solved

Calling HttpService Response From Flex AIR

Posted on 2008-06-19
1
854 Views
Last Modified: 2009-03-14
Hi Experts,
I am facing one problem, we need to call httpservices from AIR Appllication and then read the response from that httpservices.
please tell us is it possible if than please send the sample example.

Thanks and Regards,
dojjol
0
Comment
Question by:dojjol
1 Comment
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 500 total points
ID: 21830000
Here is a simple example using Flex code inside AIR you can achieve it. (change the URL's accordingly I was invoking my local servlet)

better details at:

http://livedocs.adobe.com/flex/2/langref/mx/rpc/http/mxml/HTTPService.html
<mx:Script>

	<![CDATA[

		import mx.rpc.events.ResultEvent;

		import mx.rpc.events.FaultEvent;

		import mx.controls.Alert;

		

		public function handleFault(event:FaultEvent):void

		{

			Alert.show("A Fault occured. Fault message is :"+event.fault);

		}

		

		public function handleResult(event:ResultEvent):void

		{

			Alert.show("Resut:"+event.result.toString());

		}

	]]>

</mx:Script>

	<mx:HTTPService id="EmployeeMangerClient" url="http://localhost:9000/employeeManagerService/employee/7"

fault="handleFault(event)" result="handleResult(event)" resultFormat="xml">
 

</mx:HTTPService>

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now