| By Indroniel Deb Roy, Alex Nhu | Article Rating: |
|
| September 11, 2007 03:30 PM EDT | Reads: |
32,564 |
This "ItemSearch" class is used from the application code shown in Listing 3 to invoke the service in the back-end server and to parse the response back to the AS object. The two main functions to search and parse the response through framework are:
public function searchAmazon():void{
var oper1:ItemSearch=new
ItemSearch("http://webservices.amazon.com/
AWSECommerceService/AWSECommerceService.wsdl",
onSuccess,onFault);
var lReq:ItemSearchRequest = new ItemSearchRequest();
lReq.searchIndex="Apparel";
lReq.keywords="Shirt";
var col:ArrayCollection = new ArrayCollection();
col.addItem(lReq);
oper1.call(null,"0K8EYY5Z00B7MCNQ2H82",null,null,null,null,null,col,null,null );
}
public function onSuccess(obj:Object):void{
itemSearchResponse = obj as ItemSearchResponse;
if( itemSearchResponse.items.length >0)
items = (itemSearchResponse.items[0] as
com.amazon.webservices.AWSECommerceService._2007_06_13.Items).item
trace(itemSearchResponse.toXML("ItemSearchResponse").toXMLString());
}
"ItemSearchResponse" class is generated from the wsdl and can be found in Listing-4 and inside amazon.ecs.jar file.
One point to note in the above samples is that, for REST API based application the response from the server side is needed to be parsed by the application developer with generated classes with the help of the framework, but for web services based application as the operation classes are also generated and the return for a service is already defined in the WSDL file, the response is automatically parsed to the defined class object as per the WSDL definition.
Reference Implementation
The reference
implementation for the framework is ready and I'm hoping to start an
open source project after I see the community response. The concept
explained here needs a full project to sustain all the requirements of
the enterprise and a collective effort to do it. So, if you're
interested in implementing the framework in your project and need the
recent source code please contact me.
Conclusion
This framework will solve the data
integration needs of several Flex projects in a uniquely elegant
fashion for both Web Services- and REST API-based servers. With Flex's
rich UI capabilities, this framework based on XML and e4x will
definitely give developers an upper hand in coming up with versatile
Web applications quickly. It can be a direct alternative to Flex Data
Services based on its adherence to open technologies like XML and e4x
but with the same ease of use as FDS. It also provides all the
flexibility of open source projects and won't cost big bucks to build
an enterprise application. With the advent of Adobe Integrated Runtime
(AIR) this framework can be used to build complex desktop applications
integrating different REST- and Web Service-based services.
References
Ted On Flex: XML(e4x) versus AMF www.onFlex.org/ted/2006/12/xmle4x-vs-amf.php.
Adobe - Adobe Flex 2: Flex Data Services www.adobe.com/products/Flex/dataservices/.
wsdl2as Open Source Flash www.osflash.org/wsdl2as.
Published September 11, 2007 Reads 32,564
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Indroniel Deb Roy
Indroniel Deb Roy works as an UI Architect for BlueCoat Systems.He has more than 10 years of development experience in the fields of J2EE and Web Application development. In his past he worked in developing web applications for Oracle, Novell, Packeteer, Knova etc. He has a passion for innovation and works with various Web2.0 & J2EE technologies and recently started on Smart Phone & IPhone Development.
More Stories By Alex Nhu
Alex Nhu works as a manager, UI Development at Packeteer Inc. He has more than 11 years of work experience designing and architecting complex server-side J2EE and XML applications. He loves developing Web applications with Flex now after getting a taste of developing UI using other RIA platforms.
![]() |
pixelwiz 10/14/09 12:05:00 PM EDT | |||
I've been a ColdFusion developer for about 5 years, and can do a lot of cool stuff with jQuery and alike, but time has come for me to have to write my first Flex app, and I'm hoping you might have a few suggestions. I'm doing research on if it's even possible for me to do what I need. I'm building an app to manage scores for golf tournaments, and some things like the leader boards, really need to be refreshing in real time. So as new scores come in, they should immediately be reflected on all leader boards, ideally with some animation or highlight that indicates a score just changed. Now the closest thing I've seen to what I need to do were all those CNN, Fox, CNBC apps during the last presidential elections, where as results were coming in the data was automatically refreshing. I don't even know how that works conceptually, is it the server somehow pushing the data to the Flex clients? Cause I don't want every Flex client to have to keep hitting the server every couple of seconds querying for changes like a web page would have to. Any help, suggestions, examples are highly appreciated. |
||||
![]() |
sailbv 12/03/08 10:56:23 PM EST | |||
Where are listing 3 and listing 4? |
||||
![]() |
Humberto A. Sanchez II 12/10/07 07:52:20 AM EST | |||
Are you having any success either releasing the reference implementation or starting an open source project around this? |
||||
![]() |
Indroniel Deb Roy 11/04/07 01:27:38 PM EST | |||
The wsdl2as framework mentioned here is not the wsdl2as open source one. It's a fresh implementation! |
||||
![]() |
Sebastien Arbogast 10/29/07 05:49:05 PM EDT | |||
Your framework is exactly what I'm looking for. I thought similar functionality was already embedded into Flex but to my great disappointment, it's not. So I'd really love to see what you've come up with. And if I can help, it's with pleasure. |
||||
![]() |
Indroniel Deb Roy 09/21/07 12:33:00 PM EDT | |||
This paper or the sample implementation (not currently available for public use) do not use wsdl2as tool(found in http://osflash.org/wsdl2as) to generate as3 code. The sample implementation in this paper do generate as3 code, but is implemented fresh from scratch. This paper is trying to just explain the architectural details of the approach ... |
||||
![]() |
Ryan K 09/21/07 10:02:01 AM EDT | |||
wsdl2as simply does not work. Worse, it doesn't tell you what the problem is: Exception in thread "main" java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName |
||||
![]() |
Indroniel Deb Roy 09/12/07 12:51:28 PM EDT | |||
The generated code might need to change if there are major changes in the action script language or some API change in flex web-services support. In Moxie(flex 3) release there is no major change in the AS language and flex Web Service API, so the generated code should just work fine. |
||||
![]() |
Tom Van den Eynde 09/12/07 05:45:20 AM EDT | |||
If I'm correct there will be similar support for this in Flex 3. If so: can the generated code easily be replaced by what is available through Flex 3 later on? |
||||
![]() |
Thiru Rajesh 09/11/07 11:49:09 AM EDT | |||
This is indeed a nice article on overall architecture of flex based applications based on complex server side data requirements. It will definitely serve as an alternative to FDS for programming flex ui for public web services. |
||||
![]() |
Steve 09/05/07 05:15:52 PM EDT | |||
This is one of those ideas that entice us designer crossovers with visions of easily discoverable, accessable, post-processable server-side stuff. And if we know enough T-SQL we can really take better at an architectural level. Can't help but wonder at the lack of followup/comments by the community. On the subject of compression; what's it take to bring XML into line AMF much less AMF3 (& setting aside scalability issues) for a 'text-heavy' object. What would the reverse look like? if one were defining the server-side objects from the native Flex? Couldn't we literally feed mxml components in a digestible way? |
||||
![]() |
Dave 08/24/07 09:56:39 AM EDT | |||
Could you provide a link to a much larger version of your 1st diagram? |
||||
![]() |
FDJ News Desk 08/21/07 12:59:19 PM EDT | |||
Flex has gotten popular lately because of its rich GUI capabilities. It also comes in handy with HTTPService and Web Service components connecting to back-end servers to fetch and update data. But using this mechanism to talk to the back-end server requires formulating a unique service object from the Flex side, making a request, and getting back data from the back-end either in XML or plain text format. The response data then has to be parsed and fed to the Flex objects to update the UI. For small to medium-size Flex projects it's a viable solution, but for enterprise projects with thousands of external service calls it will get quite repetitive and could result in a lot of unmanageable, buggy code. |
||||
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Adobe Flex Developer Earns $100K in New York City
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Ph.D. in Twitter Anyone?
- Eolas Sues the Internet
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Special Report on the Emerging Cloud Computing Trend
- Adobe Cans Another 9% of its Workforce
- My Thoughts on Ulitzer
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Ulitzer Live! New Media Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Executives Feature on Cloud Computing Expo Power Panel
- Software Flexibility in the Cloud - Part 4 of 5
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Where Are RIA Technologies Headed in 2008?
- Cover Story: How to Increase the Frame Rates of Your Flash Movies
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Your First Adobe Flex Application with a ColdFusion Backend
- Adobe Flex 2: Advanced DataGrid
- i-Technology Blog: Death-Knell For "Rich Media? Hardly!
- Adobe/Macromedia - Microsoft, Look Out!
- How To Create a Photo Slide Show ...
- Adobe Flex Interface Customization - Themes, Styles, Skins
- Personal Branding Checklist
- Has the Technology Bounceback Begun?
- "Real-World Flex" by Adobe's Christophe Coenraets


































