When you're interacting with the webservice, are you retrieving the SWF from the same domain
as the web service? The Flex Documentation states :

Macromedia Flash Player operates within a security sandbox that limits what Flex applications
and other Flash applications can access over HTTP. Flash applications are only allowed HTTP
access to resources on the same domain and by the same protocol from which they were served.

Having developed a few Applets I'd say this could be one of the problems if the player seems to be
spinning its wheels and not getting anywhere. I built one of the web service examples and found the
player didn't tell me I couldn't contact the service in Firefox, in IE there was a security exception and
ironically, in Netscape 8.0 I could contact the service and it worked ok. This is what I'd check first.

Secondly, you might check this out :

If you are not using Flex Data Services, you can access web services in the same domain as your Flex application or a crossdomain.xml (cross-domain policy) file that allows access from your application's domain must be installed on the web server hosting the RPC service. For more information about crossdomain.xml files, see Applying Flex Security in Building and Deploying Flex Applications.

Both of these came from the

Flex 2.0 Developer's Guide > Flex Data Features > Using RPC Components

section of the Developer's guide.


NZEYIMANA Emery Fabrice wrote:

Hello Group,
I am new here and seeking help from you.
I have created a function in my Flex application and would like to use the HTTPService object from retreiving XML data from my webservice (based on PHP).
All the examples I have seen on the Adobe website use same approach (that I don't like) of binding the object to some controls.
What I trying to achieve is: Create an HTTP object, instruct that object to retreive a web XML string, store that string locally in a variable.
Using the code I have provided below, the application gives an error saying that the object is not yet created (null). And if I watch the task bar after the error message (in Firefox), I see that the flash application is accessing the webXML.
What might be wrong?
 
 
 
private function SampleFunction():void
{
 var http:HTTPService;
 var myXML:String;
 
 http = new HTTPService();
 http.url = ""http://www.domain.com/my_xml.php">http://www.domain.com/my_xml.php";
 http.method="POST";
 http.useProxy = false;
 http.showBusyCursor = true;
 http.resultFormat = "text";
 http.send();
 
myXML = http.lastResult.toString();
 
// Do something with XML

}
__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to