Flex & Flash as Competitors to Java?

As previously discussed, my friend Joshua from Sun recently blogged about how the consumer JRE will take market share from Flash in 2008. Today Sameer Tyagi , also from Sun, blogged about problems with using Flex to front-end JAX-WS. Both posts seem to insinuate Flash and Flex as competitors to Java. Yet for me Java and Flex have always been a perfect match.

The continued success of Flash and Flex only helps to better position Java in the enterprise. Adobe is not a threat to Java’s continued dominance on the server. In fact many Adobe enterprise products are built on the Java platform including Flex Data Services. If you must have an enemy then I suggest targeting those who actually have something to gain by Java losing market share in the enterprise. That is definitely not Adobe.

As I’ve said elsewhere, Java and Flex developers should be working more closely together to make building RIAs easier for developers and to make experiencing those applications better for end users. Both technologies have similar values when it comes to openness, free tools and runtimes, and cross platform support. And the areas in which Java and Flex overlap are really very minimal. Developers and end users have much more to benefit by our harmony than by our discord. I continue to meet many people who are embracing this vision of a harmonious union of these two great technologies. I encourage others to consider doing the same.

Now to respond to Sameer’s disappointment “with the Web Services support, or lack thereof, in Adobe’s recent Flex 3.0 beta release” I built a quick Flex app which calls the non-trivial Web Service from the JAX-WS samples that Sameer referenced. Here is the code for what I came up with:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

  import mx.rpc.events.ResultEvent;
  import mx.rpc.events.FaultEvent;
  import mx.controls.Alert;

  private function handleFault(event:FaultEvent):void
    Alert.show(event.fault.faultDetail, event.fault.faultString);

  private function handleResult(event:ResultEvent):void
    Alert.show("Your shipment number is: " + event.result.shipmentNumber, "Purchase Order Accepted");

  private function submitPO():void
    var po:Object = new Object();
    po.customerNumber = "1";
    po.orderNumber = "1";

    var item1:Object = new Object();
    item1.itemID = 1;
    item1.name = "a";
    item1.price = 1;
    item1.quantity = 1;

    var item2:Object = new Object();
    item2.itemID = 2;
    item2.name = "b";
    item2.price = 1;
    item2.quantity = 1;

    po.itemList = [item1,item2];


  <mx:WebService id="srv" wsdl="http://localhost:8080/jaxws-supplychain/submitpo?wsdl" fault="handleFault(event)" result="handleResult(event)">
    <mx:operation name="submitPO"/>

  <mx:Button label="Submit PO" click="submitPO()"/>


This is a very simple example and doesn’t have the UI necessary to actually assemble a PO based on user input. That piece would also be trivial so I’ve left it out of this example. The key thing is that it correctly talks to the JAX-WS based Web Service. This is just one example which uses Java and Flex together. There are many more. And there are plenty of enterprises happily using Java and Flex together. Pitting these technologies against each other does nothing to benefit developers or end users.

  • Sameer Tyagi

    Correction – I dont work at Sun, used too in the past. You may want to correct that in the entry above.

  • Thanks Sameer. That has been fixed. Sorry I misunderstood that.


  • Les

    One of the problems is that adobe needs to be pushed into making flex do the things that other libraries do…like accessibility, solid transmission security, etc. To this point, they have not gone there. If there is some competition, then maybe one of the parties will come up with a reasonable component model for RIAs. However, if they cooperate we are likely to get more of the same (see the fall of communism :)).

  • Les,

    Flex has great accessibility support:

    And solid transmission security since we use the browser’s networking stack. Thus we support HTTPS. You can also do RTMPS if you want an encrypted real-time channel.

    Am I misunderstanding what you were referring to?


  • Pingback: .:: a few thoughts on the subject by rob wright ::. » links for 2007-08-23()

  • There is a significant difference in the Java and Flex “monetizing” models. If an enterprise wants to build a Flex application today, they need to dig deep in their pockets. The only IDE available for Flex today starts at $499/seat ($749 if you want to use charts).The Flex Data Services component you refer to above is additional $ ($20K if I m not mistaken?). Compare this with a Java+Ajax/Dojo/Javascript/other solution where everything end-to-end can be used at zero cost thanks to Sun and the huge open source community.

    If Adobe truly want to see Flex and Java work together,rather than just riding on Java’s popularity in the enterprise, it should start by loosening the reigns on the technology and worrying less about monetizing on it directly. The step to open source the SDK is a first one in the right direction. Taking ActionScript and AMF to a standards body and developing it in the community rather than unanimously would be a close second.

  • Sameer,

    There are open source / free alternatives to Flex Builder and Flex Data Services.

    Also ActionScript is an implementation of the ECMAScript specification, the same spec that JavaScript is based on.


  • Are there any free flex chart components available?

  • Hi surajz,

    Not that I’m aware of. But you can do a lot by hand just drawing your own vectors.


  • Just to add commentary to Sameer’s note about AMF. Not only has ActionScript been submitted to the Mozilla Foundation to be an open language along the lines of JavaScript see (http://www.mozilla.com/en-US/press/mozilla-2006-11-07.html) , but the AMF format itself has not been submitted for open publication as well (http://labs.adobe.com/technologies/blazeds/).

    Specfically, the press release on ActionScript is as follows:

    “Adobe Systems Incorporated (Nasdaq:ADBE) and the Mozilla Foundation, a public-benefit organization dedicated to promoting choice and innovation on the Internet, today announced that Adobe has contributed source code for the ActionScript™ Virtual Machine, the powerful standards-based scripting language engine in Adobe® Flash® Player, to the Mozilla Foundation. Mozilla will host a new open source project, called Tamarin, to accelerate the development of this standards-based approach for creating rich and engaging Web applications.

    The Tamarin project will implement the final version of the ECMAScript Edition 4 standard language, which Mozilla will use within the next generation of SpiderMonkey, the core JavaScript engine embedded in Firefox®, Mozilla’s free Web browser. As of today, developers working on SpiderMonkey will have access to the Tamarin code in the Mozilla CVS repository via the project page located at http://www.mozilla.org/projects/tamarin/. Contributions to the code will be managed by a governing body of developers from both Adobe and Mozilla.”

    And regarding AMF (and BlazeDS, the open source Data Services project)

    “Adobe is announcing its plans to contribute the proven BlazeDS technologies to the community under the LGPL v3. BlazeDS gives the rapidly growing Adobe developer community free access to the powerful remoting and messaging technologies developed by Adobe.

    Concurrent with this prerelease of BlazeDS, Adobe is publishing the AMF binary data protocol specification, on which the BlazeDS remoting implementation is based, and is committed to partnering with the community to make this protocol available for every major server platform. The source code will be available for download early 2008. Please read the FAQ for further details on BlazeDS and Adobe’s open source plans.”

  • Hi Edward,

    Did you mean to say “but the AMF format itself has also been submitted for open publication”? Changing the “not” to “also”. Since the AMF format is now a published spec.


  • Hi James –

    Yes, “Not” meant “also”…I think I did learn this great language called English once (smile)



  • Tim Goodman

    Hi James,

    I tried the example you gave with one of my SOAP servers, and I got the error below. Did you also need to update the services-config.xml file? If so, can you post that also?

    Many Thanks,

    ‘Destination ‘https://{servername}.com/soapi.pl’ either does not exist or the destination has no channels defined (and the application does not define any default channels.)’]
    at mx.messaging.config::ServerConfig$/internalGetChannelSet()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\config\ServerConfig.as:624]
    at mx.messaging.config::ServerConfig$/getChannelSet()[E:\dev\3.0.x\frameworks\projects\rpc\src\mx\messaging\config\ServerConfig.as:255]

  • Rohit

    hi James,

    Thanks for the enlighting post,it was a great help!!
    Can you explain how do we send an object array,something like this :
    public class XXX

    private var id:int;
    private var organization:String;
    private var owner:UserRecord;
    private var params:Array;
    public class UserRecord
    private var display_name:String;
    private var id:int;
    private var xx:Array;

    Now I have a tree structure..when I try to pass it as an object in the Axis webservice,It receives null.
    Object is constructed at the flex end though.

    What are the available options?Any help would be appreciated.


  • Nice article. I am sending a very complex object from flex to Java using Axis. The structure is like this

    Class A{
    var 1
    var 2
    var n
    Array B

    Class B{
    var 1
    var 2
    var n
    Array C
    Array D

    Class C{
    var 1
    var 2
    var n
    Array E

    Something like this. And on the java side, i am getting nothing. With Java test client, my webservice works very fine. But with flex client, it does not.

    Any help or suggestion is welcome.


  • Those having problems should first try the new Web Service Import wizard in Flex Builder 3. If that doesn’t work or you want to use mx:WebService please file a bug:


  • Pingback: Fears about Open Source are Real « Storagedumpasia Rumblings()

  • Jon

    Has anyone had success using the proxy classes that the new “Import Web Service (WSDL)…” function in Flex Builder 3 generate? I REALLY wish Adobe would fix up their web service support. What is the deal? As near as I can tell, it doesn’t even work. I have had some success doing it the old way without the generated classes, but, I’ve ran into numerous bugs doing it that way as well. Specifically, I’ve had a lot of issues with collections. The new way works just fine WCF, yet it seems to completely fail with JAX-WS. This to me makes no sense given Adobe seems to use Java on the backend. I don’t get it. Even Silverlight works fine with JAX-WS.

  • Hi Jon,

    SOAP Web Services are a tough thing to consistently support given all the differences in implementations. Can you file a bug for your specific problem? http://bugs.adobe.com/flex



  • @Jon

    I think I have a workaround for Flex WDSL importer with JAX-WS.

    It’s a simple wrapped parameter thing.

    Once I have imported a wsdl from jax-ws (with minimal jax-ws annotation), I opened the BaseMyTestService and searched for all the




    and set them to false.

    That’s all.

    Not sure why, since I’m not a webservice export. I’m curious thou.

  • Patrick

    Please share the modifications made to the wsdl to allow the import. I am trying to import a wsdl for an Oracle PL/SQL service, but have the same issue you are having with JAX-WS. It just doesn’t work..



  • @Patrick
    Can you also file a bug with your WSDL: