Apache – Flex WSDL to Actionscript as ant task

apache-flexwsdl

Flex Builder 3 provides support to generate actionscipt from WSDL via the GUI ( Data->Import Web Service (WSDL) ) – but this sort of method requires that you check in the generated source. This is not desirable to us (we understand both sides of the 'should generated source be checked in' and we have decided that they should not) so we would like a method to generate the actionscript classes from an ant task. In this case, the WSDL would live in the file system.

Any ideas?

Best Answer

You could spent some time digging through Flex Builder's JARs to find the libraries they're using to do this, then invoke them from a very thin custom Ant Task you write yourself. The likelihood of this succeeding is small but might be worth investigating to save yourself a ton of work, just in case.

Short of that, I'd start with WSDL2Java to generate Java classes that represent your WSDL entities. The results won't necessarily be beautiful but you should get classes that adhere to the JavaBean spec. Then you could use one of the open source Java-to-ActionScript generators which include:

  • Granite Data Services' Gas3
  • Spicefactory's Pimento, which has Java->AS3 generation

I'm almost positive that Gas3 has an Ant Task you can use; not sure about Pimento.