Creating compatible classes from WSDL for Flex 3

Two of our applications are Flex 3 web applications and WCF SOF style. To communicate with the back end, I generate client classes of web services through Flex Builder 3. Everything is functional, but saving these generated classes was rather annoying, and I'm looking for the best way to do something (without having to do large rewrite, of course). Here are the problems:

  • I use Flex libraries to manage components shared between applications. Some of them depend on the generated classes, so I need the classes created by WSDL in their own library. However, Flex Builder 3 generates classes for the Flex application, so I need to generate the files in the application source tree and then manually move the files each time. It also introduces strange side effects with how Eclipse manages the source code (why can't it just control the FS like other IDEs do?).
  • We use data binding in MXML to declaratively bind data to the user interface. I like data binding. Unfortunately, the classes in the WSDL code generation do not support binding. So I decided to create a program to modify ActionScript classes by adding [Bindable] metadata to them. This needs to be run every time we restore the code.
  • Flex has a very nasty bug, known at least since March, which has not yet been fixed: http://bugs.adobe.com/jira/browse/SDK-19811 . I recently discovered this because it was double-coding for some XML characters, such as <and in <and &. Therefore, I also had to add a workaround for this in the ActionScript manipulation program.
  • WSDL- Flex Builder String, Boolean, Int , ! , Flex .

, . - - - Flex, . RESTful Silverlight, ?

+3
2

WSDL , .

  • ServiceDescription WSDL ;
  • T4 Visual Studio , WSDL (, ServiceDescription, ).
  • XSLT, WSDL ,
  • WSDL ( XML ) , -.

, , .

+1

Unfortunatly Flex 3 WSDL Bindable, , ... .

"generated.webservices" , ... :

, ? ... ...

ANT :

; ;

<target name="updateGeneratedCode" >
    <replace dir="PATH TO YOUR GENERATED CODE">
        <include name="**/*.as"/>
        <replacetoken>public class</replacetoken>
        <replacevalue><![CDATA[[Bindable]public class]]></replacevalue>   
    </replace>

    <replace dir="PATH TO YOUR GENERATED CODE" value=":">
        <include name="**/*.as"/>
        <replacetoken>:generated.webservices.</replacetoken>
    </replace>
</target>

: ": generate.webservices." , .

.

, -!

+1

Source: https://habr.com/ru/post/1710410/


All Articles