Nagesh Mandlem

February 18, 2009

flex proxy service

Filed under: Uncategorized — Nagesh @ 8:59 pm

when we want to access a file or image or some service from third party server such as flickr , yahoo, google …etc and ans since we do not have control to create a cross-domain.xml policy file then we can use life cycle data services to get the access.

Just download any life cycle data services such as Blaze DS/LCDS/Granite DS and configure the proxy-config.xml to create a proxy service. This service will enable you the access to the third party service.

There are two ways to create a proxy based service..

  1. Default Proxy service

In this case we use  ‘dynamic-url’  element …..

<destination id=“DefaultHTTP”>
<properties>
<dynamic-url>http://cnn.com/*</dynamic-url>
<dynamic-url>http://news.yahoo.com/*</dynamic-url>
</properties>
</destination>

and at the client side we can access them by specifying use-proxy attribute set to true..

<mx:HTTPService url=”http://cnn.com” useProxy=”true” />
<mx:WebService url=”http://cnn.com/api?wsdl” useProxy=”true” />
2. Named Proxy Service:
In this case we basically create a name called destination-id to your proxy-service and use this name at client side.. In this case we do not specify the url at the client side, we just need to use destination-id attribute. This helps to change urls  when ever you want to change and this does not require to compile the flex applications.
Ex:
<destination id=”CNNFeed”>
<properties>
<url>http://rss.cnn.com/rss/cnn_topstories.rss</url>
</properties>
</destination>

To access a named proxy service from MXML:

<mx:HTTPService destination=“CNNFeed” useProxy=“true” />
For more details, please have a look at the following link…
http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=10284&productId=2
Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Banana Smoothie. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.