Hi All,
I really need to load RSS feeds directly, without PHP and FDS Proxies. My server is already too busy! :-)
I did this with my Flex Application embedded in a DELPHI Application (FlashPlayerControl component).
Yeahh. Works perfectly. The users must download a "browser" (Delphi Application) that loads my Flex Application and loads RSS feeds. Then the "browser" comunicates to Flex by ExternalInteface calls. It's fine.
But, I think there is a better way to do this. Delphi Application works at Windows only and the users must to donwload it.
I thinking about to build a IE and Firefox PLUGIN to load the RSS Feeds and send the data to Flash Player.
Does anyone have any suggestion?
Sorry my English
Gustavo Sanabio
Brazil
2006/5/2, Matt Chotin <[EMAIL PROTECTED]>:
The FDS proxy can also do this work for you (it's what it was designed
for) so if you have a server you can put it up there. And the proxy
will be available for free so you can get the benefit of our cookie
support and other goodies (which may or may not be necessary depending
on your use-case).
Unfortunately there isn't a way to circumvent the crossdomain
requirement without a proxy, it wouldn't be safe for the Player
customers if you as a developer could make your SWF hit any url you want
(because then you could try to access information the user doesn't want
you to).
Matt
-----Original Message-----
From: [email protected] [mailto: [email protected] ] On
Behalf Of oca_gw
Sent: Monday, May 01, 2006 1:52 PM
To: [email protected]
Subject: [flexcoders] Re: Help! ( Dynamic URLs for HTTPServices )
Hi Rick,
Thanks for your response, a lot of that I knew already, but its great
to post that information for the other readers too!
Here is the PHP file that I use for the Flex Weather application. I
felt that this may be of use to someone:
--------------------------------------------------------------------
<?
$url = ""
$urlString = $url . '?';
$paramCount = 0;
foreach ($_REQUEST as $key => $value)
{
if (strlen($key) > 6 && substr($key, 0, 6) == 'param_')
{
if ($paramCount != 0)
$urlString .= '&';
$urlString .= substr($key, 6, strlen($key)) . '=' . $value;
++$paramCount;
}
}
header('Content-type: text/xml');
$handle = fopen($urlString, 'r');
if (!$handle)
die('<error>Could not open specified URL</error>');
while (!feof($handle))
$result .= fread($handle, 8192);
die($result);
?>
--------------------------------------------------------------------
Basically, in your HTTPService, you now specify the address to go to
as the <url> parameter, and all parameters for that url are prepended
with the "param_" string:
<mx:HTTPService
id="myProxiedService"
url=""> <mx:request>
<url>{myDataGrid.selectedItem.Address}</url>
<param_name>{nameInput.text}</param_name>
<param_age>{ageInput.text}</param_age>
<param_secret>{mySecretVar}1234</param_secret>
</mx:request>
</mx:HTTPService>
This allows you to proxy any URL, with any set of parameters.
I have JSP and ASP(VB) versions of this also if people want. Let me
know.
Regards,
Graham Weldon
Web Development Manager
Object Connections
--- In [email protected] , [EMAIL PROTECTED] wrote:
>
> Not sure if somebody already responded - I just deleted my newest
(flexcoders)
> mail without really looking at it... and I must add the disclaimer
that I'm
> still pretty new to Flex so I could be off base here. That said,
>
> I had the same issue trying to use one HTTPService component to
access any
> number of sites by dynamically changing the url attribute. What I
found (and I
> think you too by now) is that it's not the dynamic nature of the url
causing the
> problem, but rather the cross-domain issue - hitting a different
domain than the
> one serving your swf. You mentioned using a php proxy file for your
weather.com
> project. Do the same thing here, just pass the dynamic url in the
querystring
> and extract it in the php file before going there. Assuming you put
your php
> file in the same folder as your swf, your example below would look
like:
>
> <mx:HTTPService
> id="myService"
>
url="">> resultFormat="text"/> ...
>
> and you entire php file would be:
>
> <?php
> $dataURL = $_GET["url"];
> readfile($dataURL);
> ?>
>
> If the url you're passing already has a querystring, I found a
simple way to
> handle that is to replace the '&' character with something unlikely
(I use
> '~AND~') in Flex and re-replace the '&' in php, so the entire thing
becomes one
> value, instead of trying to re-assemble the querystring in php.
>
> In this case your example would look like:
>
> <mx:HTTPService
> id="myService"
>
url="" (/&/g,'~A
ND~')}"
> resultFormat="text"/> ...
>
> and you entire php file would be:
>
> <?php
> $replacethis = "~AND~"; //& was replaced by ~AND~ in
Flex before
sending the
> httprequest
> $withthis = "&";
> $dataURL = $_GET["url"];
> $dataURL = str_replace($replacethis, $withthis,
$dataURL);
> readfile($dataURL);
> ?>
>
> Why does this work locally when obviously C:\ is not the same domain
as
> www.yahoo.com ? Because of Flash 8 security model which gives a
locally
> executing swf access to EITHER the local file system OR the www, but
not both
> (unless it's in trusted mode). In Flash, you choose which you want
in the
> publish settings. I'm pretty sure Flash defaults to local access, and
> obviously Flex defaults to www access. Search Macromedia site for
"Flash 8
> security model" for all the info on that.
>
> Sorry for the long-winded response (and for telling you stuff you
already knew),
> but I tried to be as detailed as possible to also benefit all the
newbie lurkers
> like myself. This just happens to be an issue I wrestled with for a
LONG time
> both in Flash and in Flex and I'm pretty condfident I can actually
help here -
> and start to give back.
>
> Rick
>
>
> -----Original Message-----
> From: oca_gw [mailto: graham.weldon@...]
> Sent: Sunday, April 30, 2006 10:32 PM
> To: [email protected]
> Subject: [flexcoders] Re: Help! ( Dynamic URLs for HTTPServices )
>
>
> Hi Again all.
>
> To further demonstrate this problem, I have developed the following
> sample application:
>
>
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*"
> layout="absolute" width="763" height="371">
>
> <mx:HTTPService
> id="myService"
> url="">> resultFormat="text"/>
> <mx:TextArea x="10" y="220" width="155" height="141"
> text="{myDataGrid.selectedItem.SiteTitle} -
> {myDataGrid.selectedItem.Address}"/>
> <mx:TextArea x="173" y="11" width="580" height="350"
> text="{myService.result}"/>
> <mx:DataGrid x="10" y="11" width="155" height="141"
id="myDataGrid"
> click="myService.send ();">
> <mx:columns>
> <mx:DataGridColumn headerText="Site"
dataField="SiteTitle"/>
> </mx:columns>
> <mx:dataProvider>
> <mx:Array>
> <mx:Object SiteTitle="Google"
Address=" http://www.google.com"/>
> <mx:Object SiteTitle="Yahoo"
Address=" http://www.yahoo.com"/>
> <mx:Object SiteTitle="Graham Weldon"
> Address=" http://graham.weldon.ath.cx"/>
> </mx:Array>
> </mx:dataProvider>
> </mx:DataGrid>
>
> </mx:Application>
>
>
>
>
>
> This works fine when i click "Run" in the Flex 2,0 beta 2 builder, to
> launch it as a SWF/HTML through the local browser, but as soon as I
> put it on the webserver to be deployed and publically accessible, the
> Security errors popup when the HTTPService should send().
>
> Any thoughts?
>
> Cheers, Regards,
> Graham Weldon
> Web Development Manager
> Object Connections
>
>
> --- In [email protected], "oca_gw" <graham.weldon@> wrote:
> >
> > Hi All.
> >
> > I'm working with Flex 2.0 beta 2
> >
> > This response interested me, as I have been experiencing some issues
> > with HTTP Services, and the usage of dynamic destinations.
> >
> > One example that claims to be able to do this is GuniX technology's
> > administrator's RSS2.0 Reader version 0.2. (
> > http://www.g-unix.com/bin/rss/index.swf )
> > Running this sample, entering in any RSS feed causes the following
> > error to pop up:
> >
> > Error: faultCode:Channel.Security.Error faultString:'Security error
> > accessing url' faultDetail:'Destination: DefaultHTTP'
> > at
> >
>
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faul
tHandler()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at mx.messaging::MessageAgent/fault()
> > at mx.messaging::Producer/fault()
> > at ::DirectHTTPMessageResponder/securityErrorHandler()
> > at flash.events::EventDispatcher/dispatchEvent()
> > at flash.net::URLLoader/flash.net:URLLoader::redirectEvent ()
> >
> >
> > This is the same error I got while programming my weather.com
sample:
> > http://graham.weldon.ath.cx/?page=projects&id=weather
> >
> > I solved the weather sample by creating a PHP file that fetched all
> > XML data from the weather.com service, rather than having flex
access
> > the URLs directly.
> >
> > Intially, I was attempting to databind the URL similar to:
> >
> > mx:HTTPService
> > id="myService"
> > url="" href="http://www.weather.com/blah/blah/%7BmyLocationId%7D?key=%7BmyKey%7D" target="_blank">http://www.weather.com/blah/blah/{myLocationId}?key={myKey} "
> > result="processResultXML(event);"
> > resultFormat="e4x"
> >
> > This didn't work, and raised the same error as seen on GuniX's
sample.
> > I felt that this was due to the dynamic nature of the URL ( since it
> > incorporates the location ID in the URL ) causing the error.
> >
> > GuniX's sample RSS reader will always have dynamic URLs, since it
> > databinds the url="" field to: textBox.text.
> >
> > The reason I have posted this in response to Darren's message, was
> > that I am unsure as to whether or not a cross-domain.xml file is the
> > solution, especially in the case of reading RSS feeds from remote
> > servers that the developer cannot deploy an XML file on. (also, not
> > sure if this is still applicable for Flex 2.0 beta 2)
> >
> > Is there a way to allow dynamic URLs in HTTPServices, without
causing
> > this Security error?
> >
> >
> > Regards,
> > Graham Weldon
> > Web Development Manager
> > Object Connections
> >
> >
> > --- In [email protected], "Darren Houle" <lokka_@> wrote:
> > >
> > > Pretty sure you have to place a crossdomain file on the http
server
> > you're
> > > trying to hit if you're going to run the swf off your desktop.
> > Normally the
> > > swf has rights to hit the server it's served from, but when you
run
> > a swf
> > > file sitting on your desktop it's not "served" from any server, so
> > any web
> > > server you specify would be "foreign" and would need to have a
> > crossdomain
> > > file that allowed that swf to access it.
> > >
> > > Darren
> > >
> > >
> > >
> > > >From: "compengguy" < sachingaur.83@>
> > > >Reply-To: [email protected]
> > > >To: [email protected]
> > > >Subject: [flexcoders] Help!
> > > >Date: Thu, 27 Apr 2006 13:28:15 -0000
> > > >
> > > >Hi all,
> > > >I am making a page for my teamsite where i am sending the sql
> query in
> > > >the URL. which returns an xml file. When i compile and run this
code
> > > >in Flex Builder 2.0 , It runs fine but when i take that swf
file and
> > > >run it seperately It gives the following errors.
> > > >
> > > > *****************************************************
> > > >Error: faultCode:Channel.Security.Error faultString:'Security
error
> > > >accessing url' faultDetail:'Destination: DefaultHTTP'
> > > > at
> > >
> >
>
>mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::fau
ltHandler()
> > > > at flash.events::EventDispatcher/dispatchEvent ()
> > > > at mx.messaging::MessageAgent/fault ()
> > > > at mx.messaging::Producer/fault()
> > > > at ::DirectHTTPMessageResponder/securityErrorHandler()
> > > > at flash.events::EventDispatcher/dispatchEvent()
> > > > at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
> > > > ********************************************************
> > > >what i need to do,to not to have this warning because after the
> > > >warning it not fetches the data.
> > > >
> > > >The code snippet is
> > > ><mx:HTTPService id="xml" url="" URL" useProxy="false"/>
> > > >
> > > >so can anybody suggest what i need to do ?
> > > >
> > > >Thanks
> > > >Sachin Gaur
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >--
> > > >Flexcoders Mailing List
> > > >FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > >Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > >Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
__._,_.___
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

