O'Reilly logo

Professional Adobe® Flex® 3 by Joe Berkovitz, David Hassoun, Andrew Trice, Tom Sugden, Todd Prekaski, Jun Heider, Peter Ent, Joseph Balderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 50. Integrating Flex and Java

This chapter explores more deeply into Flex RPC services, focusing on using Flex's WebService class to connect to a SOAP-based Web Service written with Java using the Grails framework. The Grails framework is an agile web development platform very similar to Ruby on Rails, except that it runs on the Java VM, which many enterprises already support in their data centers. Grails is based on the Groovy Java language extensions, which bring a lot of dynamic language syntactical sugar to the Java runtime, increasing developer productivity. With Grails, Groovy, and an XFire plug-in, which exposes Java objects at Web Services, you can create Web Services that are easily accessed from Flex applications in no time.

Building on the previous chapter's HTTPService sample, we're going to build this chapter's RPC communication with typed Web Services. While developing custom server messaging formats in pure XML is simple, it offers no runtime type-checking. The more complex the messages are that go back and forth, the more useful it becomes to have Web Services defined using WSDL (Web Services Description Language). In addition, this chapter's sample code will advance the Flex client design by breaking all the service layer calls into their own class, separating the view functionality out — a practice that you'll want to employ as the services you call increase in number and complexity. Plus, it's a stepping stone to using a full-blown Flex framework, like ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required