View Full Version : Flex builder 2 beta 1 HTTPService problem

02-28-2006, 06:42 PM
Im trying to get a simple HTTPService call to work.

To test it I am using a static xml file called test.xml. When I call the HTTPService on my local machine it works fine but when I upload the swf to the server it throws a wobbly - something along the lines of:

Error: code:Server.Error.Request string:'HTTP request error' detail:'Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false text="Error #2032: Stream Error. URL......

I was thinking it had something to do with flex-services.xml but I can't even find this file and can't find any examples of what this file should have as its contents.

Just out of interest I am then loading the contents of the xml into a richtexteditor for (hopefully) editing.

Thanks in advance.

02-28-2006, 07:40 PM
I realised I'd made a schoolboy error.

Just needed to add the cross-domain.xml policy file and everything worked fine.

02-28-2006, 08:43 PM
flex-services.xml is only needed if you are using the FES capabilities.

03-06-2006, 12:45 PM
I'm new with Flex and don't know how to send an HTTP request to an URL pointing to a remote location in another computer.

Basically I'm trying to send a HTTP request to a remote computer with Cocoon installed. The entry actualitza1.xml reads the http request parameters and calls the PL procedures that access the database.

When it attemps to reach the specified url in the <mx:HTTPService> tag, it launches the following error:
"Security error accessing url"
When I debug the application, I get a Sandbox security violation... can anyone help me with this, please...

May I use a crossdomain.xml file somewhere in the remote computer??
May I write a destination entry in the Flex configuration files?

Any help will be appreciated

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" initialize="srvpost.send()">

import mx.controls.Alert;

<!-- Security error accessing url -->
<mx:HTTPService id="srvpost"
<femail>[email protected]</femail>

03-06-2006, 02:00 PM
you need a crossdomain policy file on the machine you are trying to access. go read up about crossdomain files (google: moock crossdomain)

12-10-2007, 01:28 AM
I am new to flex, in fact this is my first attempt at doing anything with it. I am trying to retrieve XML data from a remote server and display it on a pie chart. I have created crossdomain.xml on the remote server, here are its contents:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<allow-access-from domain="*" secure="false"/>

Here is my flex code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="pollRequest.send()">
<mx:HTTPService id="pollRequest" url="http://www.mydomain.com/poll_result.xml" showBusyCursor="true" useProxy="false" />
fills:#F15E22, #A1CD44, #999999;
fontFamily: Arial, Helvetica;
<mx:Panel title="{pollRequest.lastResult.title}" height="230" width="210" paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0" fontFamily="Arial" cornerRadius="0" verticalGap="0">
<mx:PieChart id="pieChart"
height="100%" width="100%" fontWeight="normal" fontFamily="Arial" fontSize="9"
paddingTop="0" paddingRight="0" paddingBottom="0"
<mx:PieSeries field="Votes" nameField="Option" calloutGap="0" labelPosition="none">


<mx:Legend dataProvider="{pieChart}" fontSize="9" paddingBottom="0" paddingTop="0" markerHeight="5" markerWidth="5" fontWeight="normal" fontFamily="Arial" verticalGap="0"/>

Here are the contents of poll_result.xml:

<?xml version="1.0" encoding="utf-8"?>
<title>Poll Question?</title>
<choice>Choice 1</choice>
<choice>Choice 2</choice>
<choice>Choice 3</choice>

I can tell that a request to the xml file on the remote server is being made, but no data is being pulled out. What am I doing wrong? Any help is appreciated.

11-18-2009, 01:21 AM
I think you should add resultFormat="e4x" to indicate that the expected result format is xml