When accessing URL’s through HttpServices from a remote domain, it often works fine on the local system but fails to connect when the swf is uploaded to the web (google searh ‘flex crossdomain.xml proxy’).
A common way around this is to place a PHP file on your web server that acts as a go-between for the remote site and the swf (an example discussed on Dennis Jaamaan’s site, with proxy code).
This article explains how to setup a local PHP server, and test your PHP proxy locally through Flex Builder 3
1. Download a PHP server: http://www.wampserver.com/en/download.php
2. Install it, leaving whatever default settings it suggests.
3. Click the WampServer taskbar icon, and go to PHP/PHP_extensions/ and click php_curl (need to enable this to use the example below). Then click Start All Services & Put Online.
4. Create a php file named flexProxy.php and put in the code below:
<?php $ch = curl_init(); $timeout = 30; $userAgent = $_SERVER['HTTP_USER_AGENT']; $url = $_REQUEST['url']; $place = $_REQUEST['place']; $fullGoogleWeatherPath = $url . $place; curl_setopt($ch, CURLOPT_URL,$fullGoogleWeatherPath); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $response = curl_exec($ch); if (curl_errno($ch)) { echo curl_error($ch); } else { curl_close($ch); echo $response; } ?>
5. Save this file and put it in the localhost directory: C:\wamp\www\
6. Now for the Flex part. In a new project, create a webservice like the following one:
<mx:HTTPService url="http://localhost/flexProxy.php?" id="googleWeatherService" method="POST" showBusyCursor="true" resultFormat="e4x" fault="serviceFault(event)" result="googleResult(event)"> <mx:request xmlns=""> <url>http://www.google.com/ig/api?weather=</url> <place> {googleRequestString} </place> </mx:request> </mx:HTTPService> <mx:TextArea x="459" y="133" width="419" height="297" id="googleResultTextArea" text="{googleWeatherService.lastResult.weather}" />
7. Somewhere in you code set the googleRequestString and call the web service:
googleRequestString = “Dublin,Ireland”;
googleWeatherService.send();
This should then populate the textArea as its text is bound to the lastResult. Nice one.
8. When you want to load your code to the web, change the following bit of code:
<mx:HTTPService url=”http://localhost/flexProxy.php?”
to
<mx:HTTPService url=”assets/flexProxy.php”
and make sure that you have included an ‘assets’ forder in your source with ‘flexProxy.php’ inside it.
9. In Flex Builder 3 go to Projects, Export release build, and copy all the files/folders in the release-build folder to your web server.
10. Bada bing, you’ve got google weather data (how do these thing always work out to 10 steps?)
Update: to test for errors/conflicts directly put the following in your browser:
http://localhost/flexProxy.php?url=http://www.google.com/ig/api?weather=&place=Dublin,Ireland
You wont see the xml response, but you should get no errors.
Use http://www.google.com/ig/api?weather=Dublin,Ireland to see the xml.
Tags: crossdomain.xml, Flex, local, locally, PHP, Proxy, server
October 16, 2010 at 7:17 am |
Dear Sir
thank very much. your blog is very useful to me. It is ultimate.
I have solve many problems of VISUAL STUDIO 2008 deployment related.
Thank you again,
May 9, 2017 at 8:47 pm |
Do you have more great arceilts like this one?
August 28, 2017 at 9:49 pm |
Yes with no problem just try and keep the voltages as low as possible this way it does not get to hot. If your not going to mess around with the Voltages then just leave it on auto you well be fine 100%
November 7, 2010 at 5:10 am |
Hello,guy!I like this article,your blog is great!
May 7, 2011 at 9:21 pm |
LnJ2uZ http://gdjI3b7VaWpU1m0dGpvjRrcu9Fk.com
September 5, 2011 at 4:20 pm |
One moment, please photos cute preteens 371
September 17, 2011 at 3:31 pm |
I’m from England young teen sexx 28651
September 22, 2011 at 1:18 pm |
Recorded Delivery Pics Of Teenies Bbs
=-PP
January 5, 2012 at 7:25 am |
The total glance of your site is great, let smartly as the content! 969429
May 10, 2017 at 1:01 am |
My favorite bird Martina )Two wonderful captures of itw382#0;.&ow i loved to go out for the birds but i don’t have the time at the moment ;( But i’m enjoying your photo’s right now ;-D
March 12, 2012 at 7:10 pm |
Some genuinely good and utilitarian information on this web site, as properly I believe the style has got excellent capabilities. 106945
March 12, 2012 at 11:07 pm |
What others have stated and in some uncommon cases, suicide may occur. 260870
March 13, 2012 at 1:53 am |
I conceive this internet web site has got some really superb information for everybody : D. 797850
March 13, 2012 at 2:18 pm |
I undoubtedly didnt recognize that. Learnt some thing new nowadays! Thanks for that. 89974
March 13, 2012 at 11:08 pm |
I must test with you here. Which is not one thing I normally do! I enjoy studying a submit that will make people think. Also, thanks for allowing me to comment! 816144
March 14, 2012 at 5:09 am |
I see something actually fascinating about your internet web site so I saved to bookmarks . 113309
March 18, 2012 at 10:57 am |
Yay google is my king helped me to locate this outstanding web site! . 975051
March 19, 2012 at 6:32 pm |
The digital cigarette makes use of a battery and a small heating element the vaporize the e-liquid. This vapor can then be inhaled and exhaled 715749
May 9, 2017 at 8:52 pm |
The accident of finding this post has brntigehed my day
March 19, 2012 at 8:12 pm |
Merely wanna state that this really is really beneficial , Thanks for taking your time to write this. 610969
March 20, 2012 at 12:41 pm |
I like your writing style truly loving this internet site . 59699
March 20, 2012 at 5:03 pm |
superb post. Neer knew this, appreciate it for letting me know. 954291
March 21, 2012 at 7:02 pm |
Intriguing post. Positive that Ill come back here. Good function. 977934
March 22, 2012 at 3:42 am |
Delighted for you to discovered this site write-up, My group is shopping a lot more often than not regarding this. This can be at this moment undoubtedly what I are already seeking and I own book-marked this specific site online far too, Ill often be maintain returning soon enough to appear at on your special weblog post. 802100
March 25, 2012 at 5:33 pm |
There is noticeably lots of cash to comprehend about this. I assume youve created certain nice points in functions also. 853350
May 9, 2017 at 9:31 pm |
If you’re reading this, you’re all set, pardren!
March 25, 2012 at 7:11 pm |
I respect your piece of function, appreciate it for all of the intriguing content material . 604661
March 26, 2012 at 6:49 am |
You must participate in a contest for among the best blogs on the web. I will suggest this web site! 534922
March 26, 2012 at 6:48 pm |
Great post, Im looking forward to hear more from you!! 496353
May 10, 2017 at 1:50 am |
Qué excelente idea, amiga! me encantan las manzanas asadas…en casa las comemos muy a menudo pero nunca se me habrÃa ocurrido prepararlas &q&!s;abrigaditatuquot;o!! exquisitas!!!!!!!!!!!!!
March 29, 2012 at 2:29 pm |
What a lovely weblog. Ill surely be back once again. Please preserve writing! 105279
March 30, 2012 at 10:15 am |
Very informative post. Your current Website style is awesome as well! 920841
March 31, 2012 at 5:51 am |
Excellent humans speeches and toasts, possibly toasts. are hands down transferred at some time by means of party and expected to turn into really funny, amusing not to mention educational inside the mean time. finest man wedding speeches 879367
March 31, 2012 at 2:27 pm |
Thanks for the info provided! I was researching for this write-up for a long time, but I was not able to see a dependable source. 847768
March 31, 2012 at 10:24 pm |
Thankyou for all your efforts which you have put in this. really fascinating information . 787096
April 1, 2012 at 2:05 am |
I adore your wp style, wherever did you download it by means of? 168923
April 2, 2012 at 12:39 am |
As soon as I found this internet site I went on reddit to share some of the love with them. 223318
April 4, 2012 at 3:24 pm |
Really superb details can be located on weblog . 270463
April 5, 2012 at 11:46 am |
You got a really superb site, Glad I noticed it by means of yahoo. 605325
April 6, 2012 at 12:37 am |
Wonderful post, thank you so considerably for sharing. Do you happen to have an RSS feed I can subscribe to? 980402
April 6, 2012 at 12:29 pm |
Quite very good written post. It is going to be valuable to anybody who usess it, including myself. Maintain up the very good function – canr wait to read far more posts. 580612
April 6, 2012 at 10:44 pm |
Definitely composed content material material , thankyou for data . 530692
April 8, 2012 at 5:13 am |
I actually like your writing style, excellent information , thankyou for putting up : D. 751651
April 8, 2012 at 11:47 pm |
Yay google is my king assisted me to find this outstanding site! . 300790
May 10, 2017 at 1:00 am |
ya ke terubah tu amat bendar bajik bala sekeda deka mai aram beekgala..nlrap ke kita ila enda sumbung enti nyema bisi orang talipaun suh kita..anang enggai bejaku au wai..nya aja ari aku..hehehe
April 9, 2012 at 9:22 am |
Nice site, nice and easy on the eyes and great content too. Do you need many drafts to make a post? 377117
April 9, 2012 at 9:40 am |
Good post, well put together. Thanks. I will be back soon to check out for updates. Cheers 218653
April 9, 2012 at 9:40 am |
Have read a couple of of the articles on your web site now, and I truly like your style of blogging. I added it to my favorites weblog site list and will probably be checking back soon. 13000
April 10, 2012 at 10:55 am |
youve got an crucial weblog proper here! would you wish to make some invite posts on my weblog? 403984
April 11, 2012 at 7:46 pm |
Awesome weblog, Im going to spend a lot more time researching this subject 641495
April 14, 2012 at 1:46 pm |
I like this internet web site its a master peace ! Glad I detected this on google . 877927
April 17, 2012 at 2:14 pm |
A thoughtful opinion and ideas Ill use on my internet page. Youve certainly spent some time on this. Properly carried out! 454194
April 17, 2012 at 9:03 pm |
I like this site so much, saved to favorites . 911431
April 21, 2012 at 3:50 pm |
Lots of writers recommend just writing and composing no matter how bad and if the story is going to develop, youll suddenly hit the zone and itll develop. 885019
April 21, 2012 at 4:37 pm |
In todays news reporting clever journalists function their very own slant into a story. Bloggers use it promote their works and a lot of just use it for enjoyable or to stay in touch with pals far away. 435490
May 10, 2017 at 12:54 am |
This is so vintage and pretty. Nice colours on the background too. So pleased your enjoying our chlseangel, thanks for your continued support at Make My Monday. Caz
April 22, 2012 at 1:21 pm |
Ive just been talking to Sean Gallagher about his upcoming Instant Income Cash Machine course, and hes been kind enough to fill me in on a couple of details regarding his upcoming course. 799029
April 22, 2012 at 4:41 pm |
I really like your writing style, good information, appreciate it for posting : D. 785914
April 23, 2012 at 4:46 pm |
More than and more than once again I like to take into consideration this troubles. As a matter of fact it wasnt even a month ago that I thought about this quite thing. To be honest, what could be the answer though? 462607
April 23, 2012 at 7:57 pm |
Wow, awesome blog structure! How long have you been running a blog for? you made blogging look easy. The total look of your site is wonderful, let alone the content material! 524325
April 24, 2012 at 2:55 am |
I was looking for this. Really refreshing take on the information. Thanks a lot. 290450
April 24, 2012 at 3:24 am |
Hi this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. Im starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience. Any help would be greatly appreciated! 829670
April 25, 2012 at 5:21 pm |
if this post was likened to a flavor of yogurt, what flavor would it be? Banana, I think. 822292
April 26, 2012 at 5:22 pm |
Hi this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. Im starting a blog soon but have no coding knowledge so I wanted to get guidance from someone with experience. Any help would be greatly appreciated! 411276
April 26, 2012 at 8:16 pm |
for however one more wonderful informative post, Im a loyal reader to this weblog and I cant stress enough how considerably valuable data Ive learned from reading your content material. I genuinely appreciate all of the hard function you put into this wonderful weblog. 461830
April 26, 2012 at 9:23 pm |
This will be a terrific blog, would you be interested in doing an interview about just how you developed it? If so e-mail me! 910718
April 26, 2012 at 10:01 pm |
Giving you the most effective News is really significantly imptortant to us. 218320
April 27, 2012 at 10:02 am |
I like this web site very much, Its a really nice post to read and get info . 458149
April 29, 2012 at 10:32 am |
This internet website is my aspiration, extremely outstanding design and Perfect articles. 183527
April 29, 2012 at 3:05 pm |
A blog like yours should be earning much money from adsense..-., 181298
April 30, 2012 at 12:00 pm |
Id forever want to be update on new posts on this site , bookmarked ! . 745648
May 2, 2012 at 1:11 am |
I will tell your buddies to go to this website. .Thanks for the write-up. 134670
May 2, 2012 at 7:59 pm |
What are the hours of work? http://naehegija.de.tl ls nonude models Could anything be better than having an entire team fuck you outdoors? This girl is living my dream…to be naked and esposed gangbanged outdoors and in public by a huge gang of men…anyone who happened by could see them all plunging their cocks into me and see how I was loving each stroke of those dicks as they rammed into me again and again!
May 7, 2012 at 7:21 am |
An estate agents http://usifupurasepi.de.tl tit little pussy She’s cute and looks like she enjoyed it but i don’t know if i could rub dicks with another man even to make her happy.
May 24, 2012 at 8:37 am |
How do you make a blog site look this good!? Email me if you want and share your wisdom. Id be appreciative!
August 3, 2013 at 8:51 am |
A five-page words in addition to color selection graphics impress basically brought A couple of.
23ppm, however, not just 50 % your posted number.
Photos patterns originated by means of somewhat swiftly,
with a Fifteen y 10cm shoot with high-quality choosing One particular:Thirty-four and then a comparable photograph, with natural top
quality originating from a PictBridge digicam, required fairly zippy
Fifty-seven moments. tonery samsung scx-3405fw cartridge point todmorden walmart ink cartridges hp 564
Moen Výměna cartridges cartridge comparison
guide 2 měnící se inkoustová cartridge HP Deskjet 1050 tonery SAMSUNG ML-2510 cartridge
bottom bracket removal.
May 21, 2018 at 4:16 am |
Youre so cool! I dont suppose Ive read anything in this way before. So nice to discover somebody with original ideas on this subject. realy thank you for beginning this up. this website is a thing that is needed on the net, somebody with a little originality. beneficial problem for bringing interesting things on the internet!
November 11, 2018 at 12:57 pm |
One more thing. I do believe that there are lots of travel insurance web-sites of respectable companies that permit you to enter a trip details and have you the quotations. You can also purchase the particular international holiday insurance policy on the net by using your current credit card. All you should do would be to enter your own travel specifics and you can see the plans side-by-side. Simply find the package that suits your financial allowance and needs and then use your credit card to buy the idea. Travel insurance on the web is a good way to take a look for a reputable company with regard to international holiday insurance. Thanks for giving your ideas.