Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flex > Flex 2 & 3

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-28-2006, 07:42 PM   #1
ry_mawby
Registered User
 
Join Date: Oct 2004
Posts: 12
Default Flex builder 2 beta 1 HTTPService problem

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.
ry_mawby is offline   Reply With Quote
Old 02-28-2006, 08:40 PM   #2
ry_mawby
Registered User
 
Join Date: Oct 2004
Posts: 12
Default sussed it

I realised I'd made a schoolboy error.

Just needed to add the cross-domain.xml policy file and everything worked fine.
ry_mawby is offline   Reply With Quote
Old 02-28-2006, 09:43 PM   #3
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

flex-services.xml is only needed if you are using the FES capabilities.
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 03-06-2006, 01:45 PM   #4
nahruk
Registered User
 
Join Date: Jan 2006
Posts: 2
Default I have another HTTPService problem

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
Thanks!


Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" initialize="srvpost.send()">
	
	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;
		]]>
	</mx:Script>
	
	<!-- Security error accessing url -->
	<mx:HTTPService id="srvpost"
    			method="POST" 
    			useProxy="false"
    			resultFormat="xml" 
    			fault="Alert.show(event.fault.faultstring);"
    			result="myText.text=srvpost.result.toString()"
    			url="http://myIP:8888/curs/actualitza1.xml">
    		<mx:request>
			<fdni>155959792</fdni>
			<ftlf>971232323</ftlf>
			<femail>nom.llinatge@email.es</femail>
		</mx:request>
	</mx:HTTPService>
</mx:Application>

Last edited by nahruk; 03-06-2006 at 01:48 PM..
nahruk is offline   Reply With Quote
Old 03-06-2006, 03:00 PM   #5
hangalot
lala
 
hangalot's Avatar
 
Join Date: Feb 2002
Location: on the road
Posts: 2,859
Default

you need a crossdomain policy file on the machine you are trying to access. go read up about crossdomain files (google: moock crossdomain)
__________________
oi poloi
http://www.memorphic.com/news/
hangalot is offline   Reply With Quote
Old 12-10-2007, 02:28 AM   #6
flex_newbie
Registered User
 
Join Date: Dec 2007
Posts: 1
Default HTTPService remote XML file

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">
<cross-domain-policy>
<allow-access-from domain="*" secure="false"/>
</cross-domain-policy>

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" />
<mx:Style>
PieSeries
{
fills:#F15E22, #A1CD44, #999999;
fontSize:8;
fontFamily: Arial, Helvetica;
fontWeigh:normal;
}
</mx:Style>
<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"
dataProvider="{pollRequest.lastResult.poll.option} "
showDataTips="true"
height="100%" width="100%" fontWeight="normal" fontFamily="Arial" fontSize="9"
paddingTop="0" paddingRight="0" paddingBottom="0"
>
<mx:series>
<mx:PieSeries field="Votes" nameField="Option" calloutGap="0" labelPosition="none">

</mx:PieSeries>
</mx:series>

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

Here are the contents of poll_result.xml:

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

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.
flex_newbie is offline   Reply With Quote
Old 11-18-2009, 02:21 AM   #7
nikunjnemani
Registered User
 
Join Date: Nov 2009
Posts: 1
Default HTTPService remote XML file

I think you should add resultFormat="e4x" to indicate that the expected result format is xml
nikunjnemani is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about Flex 2 vistasoul Flex 2 & 3 1 02-28-2006 05:07 AM
Flex 2 BETA !? Xeef Flex 2 & 3 3 11-30-2005 04:04 PM
Database Solution for Flash... Calling Beta Testers INM Projectors and CDs 3 10-25-2005 07:02 PM
swfBB Bulletin Board Beta Signups Immulsifier General Chat 0 06-16-2005 04:23 PM
problem with using POST and variables (flash-php-windows)... Jukkis ActionScript 1.0 (and below) 1 05-08-2002 06:56 PM


All times are GMT. The time now is 11:53 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.