Flex RPC mapping Java nested classes to ActionScript classes

We are calling a Java method in our project using
RemoteObject the value returned by the java method is a ArrayList
containing instances of a class say ParentClass with some nested
classes.
The structure of ParentClass(Java) is something like this
class ParentClass {
//some primitives
private ChildClassA childAInstance;
private ChildClassB childBInstance;
//getters setters
We have created similar class structure on the ActionScript
side, the ActionScript classes(ParentClass,ChildClassA
,ChildClassB) have been properly annotated with the [RemoteClass]
metadata tag,
The problem is that though i'm getting the primitive data
members of the ParentClass through RPC in my corresponding AS
ParentClass class i'm getting an runtime exception trying to access
ChildClassA,ChildClassB members.
Am i missing something, exactly the same scenario is
mentioned in this article
http://www.adobe.com/devnet/flex/articles/complex_data.html
But the Object.registerClass method mentioned in the tutorial
is giving me compilation error, the sample code attached with the
article is corrupt zip too.
Please help me out on this

JAXB will create classes from an XML schema, SAX is a parser library and JAXP is a library of XML a bunch of XML tools.
I don't care for JAXB too much. I would skip it and go right to the JAX-RPC spec (WebServices).

Similar Messages

  • How to Map Java Beans to appropiate ActionScript class ??

    Hi
    I find it  difficulty in writing a ActionScript class for java Bean.
    Is there any automation  tool avialable which will generate an ActionScript class basing on the java Bean ??
    Thanks in advance .

    I think GraniteDS has a tool for it.

  • Flex Builder stops compile new ActionScript classes

    Hello,
    Does anyone knows what could cause Flex Builder 3.4 stops compiling NEW ActionScript classes? I have been working on Flex project for a while, we have some MXML and .as files (less than 200). This morning Flex Builder suddenly stopped detecting errors in new as classes, but not so for older classes. Thanks and appreciate your help.
    - Weiping

    Are your new classes referenced from the old code? Mxmlc employs a questionable form of "as-needed" linking, so classes that are not referenced from the main application are not even compiled. This referencing requirement is recursive; that is, any classes that are to be included have to be referenced from the main application, or from classes referenced by the main application, or from classes referenced by classes referenced by the main application, and so on. But if your new classes are not referenced at all from the old code, they will be ignored.

  • Mapping existing actionscript class (mx.collections.SortField) to java

    Hi,
    I would like to map the existing SortField actionscript class on a SortField class on my java backend.
    Is it possible to map an actionscript class from standard flex API to a java class? If so, how?
    Thanks

    Yeah, there is something awry with your mapped classes.  You don't use the java source files to map your classes, you use AS3
    classes that are designated to which classes they map to on the backend.  Observe..
    package shared.servicevos
       import flash.events.EventDispatcher;
       import flash.events.IEventDispatcher;
       [Bindable]
       [RemoteClass(alias="amf.ShopperVO")]
       public class ShopperVO
           public var shopperId:int;
           public var shopperLocation:String;
           public var shopDate:Date;
           public var shopperAddress:Address
    If you notice the the metadata beginning with "RemoteClass", I am telling Flex "when you see an object that comes in with this type "alias" it is should be made into a ShopperVO".  On the backend, I have a folder with a directory structure of /amf and it contains a ShopperVO.java class.
    P.S This isn't exactly the setup I am working with cause I am using php, but the ideas are the same.

  • Mapping java classes to XML files

    Hi Friends !!
    Please I need your help.
    Does somebody out there know any framework or API that helps me to map Java classes to XML files.
    Something like:
    public class Test {
        public int x;
        public int y;
        public int sum(){}
    }to something like:
    <?xml version="1.0" encoding="UTF-8"?>
    <class>
    <className>Test</className>
    bla
    bla
    bla
    </class>
    Any tips?
    Thanks in advance
    Cleverson

    JAXB will create classes from an XML schema, SAX is a parser library and JAXP is a library of XML a bunch of XML tools.
    I don't care for JAXB too much. I would skip it and go right to the JAX-RPC spec (WebServices).

  • How to call setter Method of ActionScript class with in a Flex Application

    Hi
    I have Action class as shown :
    public class MyClass
    private var name:String 
    public function get name():String {
        return _initialCount;
    public function set name(name:String):void {
        name = name;
    Now please let me know how can i access this Action class under my Flex Application and call the setter Method of it to set the value for the name .
    For example on entering some data in a TextInput and  click of a submit Button , on to the Event Listener , i want to call the set name method of my ActionScript class .
    Please share your ideas on this .

    Thanks  Gordon for your resonse .
    Say for example my Action class is like this :
    public class MyClass
    private var name:String 
    public function get name():String {
        return name;
    public function set name(name:String):void {
        name = name;
    This is inside the MXML
    I know this way we can do it
    public var myclass:MyClass = new MyClass();
    myclass.name="Kiran";
    Now my query is can we do in this way also ??
    myclass.set name(SomeTextInput.text);
    Please share your views on this , waiting for your replies .
    Thanks in advance .

  • ActionScript class being run by mistake in Flex project

    I have a Flex project where my main MXML file is set as the
    one and only application file and is also set as the default file.
    I also have an ActionScript class in the project that extends
    Sprite. It is _not_ set as an Application file.
    When I have the ActionScript class selected, if I hit run or
    debug, FB3 creates a new launch configuration for it and tries to
    run the AS file instead of the default application MXML file.
    Needless to say, this is really annoying as it means I have
    to select the main MXML file before hitting debug/run every time.
    Is this a bug or feature? (Feels like a bug).
    Thanks,
    Aral

    Hi Aral,
    Can you please log it in our public bug system:
    http://bugs.adobe.com/flex?
    It'd be great if you can provide more info to the bug e.g.
    reproducible steps, platform, FB version (Plugin or Standalone).
    thanks,
    Sharon

  • Flex Gumbo - Library Path "Include all classes" includes ActionScript Files

    I've added an "Actionscript File", i.e. a File with no package/class that is included in an actionscript class.
    In FlexBuilder 3, since there was no option to include all classes, I could optionally choose actionscript files.
    So, Make Flashbuilder's "include all classes" option to not include Actionscript Files by default.

    I opened a bug on jira.
    http://bugs.adobe.com/jira/browse/FB-22228

  • Blaze DS - Mapping java object into another java application

    Good afternoon,
    I realized a Client-Server application. Server is Java-based. Client is Flex. Server services are accessible through Blaze DS.
    Now I have some Java clients that need to access server services. Blaze DS permits to do it simply but I don't know how to map java objects as I do using [RemoteClass(alias.....)] construct at Actionscript side.
    For example, server sends a MyObjectType and client receives an ASObject.
    Is there a way to map java MyObjectType automatically at destination?
    Thank you for help and sorry for poor english.
    Regards, Francesco

    xstream will convert any given java object to xml. Not sure what support it offers for schemas.
    http://xstream.codehaus.org/

  • Converting MXML Components to ActionScript Classes

    I'm in the process of converting most (if not all) of my MXML
    components to Action Script classes. I've found this is easy, and
    doesn't require a lot of extra code when extending a simple
    container or control. However, several of my MXML components have
    several nested containers and controls - i.e. a component that
    contains several Labels, a ComboBox, a TextInput, a Button, and a
    DataGrid, plus several other containers needed for layout. To code
    the layout of all these containers and controls using MXML, it uses
    about 16 lines of code. To code the layout in ActionScript, it
    takes about 50+ lines of code (see attached).
    I'm just wondering if there are any best practices for
    creating ActionScript classes that include several (or even A LOT
    OF) containers and controls. It's very easy to layout in MXML, and
    is more visibly pleasing to look at and understand, but I feel it
    is best practice to code components as ActionScript classes. I know
    I should be using MVC, but it's a little late to rewrite the entire
    application now.
    Any thoughts?

    I can't specifically speak to how to write layout code in
    ActionScript, but you can look at the generated code that Flex
    creates to get an idea of how Flex does it. When you compile an
    app, the Flex compiler takes your MXML input and converts it to
    ActionScript classes before compiling the entire set of classes
    into a SWF. Because of this, you can look at the interim
    ActionScript code.
    You do this by setting the keep-generated-actionscript
    compiler option to true and looking in the /generated directory.
    hth,
    matt horn
    flex docs

  • How to set an actionscript class runnable + some question?

    Dear all,
      i am new to actionscript (Flex 3).
      i am from java camp and i want to achive some java-style functionality in actionscript,and hope you can help me:
      1. how to set an actionscript class runnable??
          in java, i just add a "public static void main(String[] args)" method which will be the program entry point. (IDE, right click the class and click run)
          i can't set a plain, ordinary actionscript runnable in flex builder.
          To test the class, i have to create an mxml (which in turn invoke the testing class) and it be runnable in the flex builder 3.
          any other way to ease the testing?
       2. it there any good 3rd party library for datatype conversion ? (e.g. string <> date, the build-in DateFormatter don't accept milliseconds)...
           it seems actionscript come with limited such kind of utility function
       3. in a custom mxml component, which contains several controls (say testboxes, comboboxes)...etc,
           for information hiding/prevent others to change the child controls in the custom component, how can i hide the child control, not allow
           other code to access the child by  "Component.textbox1"....any scope modifier, e.g. protected, private...etc in mxml?
       thank you.
    ppk luk

    Hi Alex,
      for question 3:
      i just wondering if it is ok or not for better code/validation.....(and it follow the good
    information hiding principle?)
      if i write the component in actionscript only, i can set the child control with scope modifier
    'private' or 'protected'..so that the component user can't just use the dot syntax to gain
    access to the child control,
    e.g. MyComponent.childControlTextInputBox.value = "A";...
    i want to force user to use MyComponent.setInputBoxValue("A")...
    (e.g. in this method, i can do some checking/validate before passing to the textbox)
      this can enforce the data consistency in my custom UI component...
      there is no way to achieve the same effect in MXML?
    (e..g <mx:TextInput id="privateChildControl" accessScope="private" .../>)
      thank you..

  • Mapping java.util.hashtable

    Hello all
    I have a requirement of mapping java.util.hashtable to Oracle9i database. I read on the application developers guide that this type can not be mapped through the Workbench GUI and you need to write code for it.
    I followed the example code as below
    DirectMapMapping directMapMapping = new DirectMapMapping();
    directMapMapping.setAttributeName("..");
    directMapMapping.setReferenceTableName("..");
    directMapMapping.setReferenceKeyFieldName("..");
    directMapMapping.setDirectKeyFieldName("..");
    directMapMapping.setDirectFieldName("..");
    directMapMapping.setKeyClass(String.class);
    directMapMapping.setValueClass(Integer.class);
    descriptor.addMapping(directMapMapping);
    The insertion to the database went very well but while retriving the data from the database i am getting the following error.
    Exception Description: Trying to set value [[DatabaseRow(
         DUMMYTABLE.KEYVALUE => 100
         KEYNAME => 1), DatabaseRow(
         DUMMYTABLE.KEYVALUE => 200
         KEYNAME => 2)]] for instance variable [dummyTable] of type [java.util.Hashtable] in the object. The specified object is not an instance of the class or interface declaring the underlying field, or an unwrapping conversion has failed.
    If any one has any idea, please let me know.
    Thanks in Advance

    Which version/patch is this running? I don't know of any specific bugs to this, but there have been a couple of minor seemingly-unrelated fixes to DirectMapMapping, but sometimes they're more related than you think.
    The exception is saying the types aren't matching up. You are 100% sure the attribute you're mapping to is a java.util.Hashtable? It shouldn't be necessary, but you might want to call directMapMapping.useMapClass(java.util.Hashtable.class);
    - Don

  • Is it possible to use mx.controls in ActionScript class?

    I am very new to Flex, with a very small amount of experience in ActionScript so forgive me if the answer to this is obvious. I've tried searching and haven't found a conclusive solution to my problem.
    I have a Flex project that I am building in Flex Builder 3. The main application is in mxml, but most of the classes I'm using are in ActionScript.
    The general purpose of the application is to create a flowchart that accepts certain inputs on the elements in the charts. The chart components are all ActionScript classes. I am attempting to add a combobox to a component, but despite not getting any errors or warnings I can't get the combobox to show up.
    Here's a simplified version of the code within the class (I've left out the stuff that doesn't directly relate to my issue):
        import mx.controls.ComboBox;
              newComboBox = new ComboBox();
              newComboBox.initialized = true;
              newComboBox.alpha = 1;
              newComboBox.dataProvider = valueArray;
              newComboBox.x = 5;
              newComboBox.y = -5;
              newComboBox.height = 20;
              newComboBox.width = width - 60;
              newComboBox.visible = true;
              addChild(newComboBox);

    Just realized I hadn't thanked anyone for the suggestions yet. I appreciate it.
    Srirangan wrote:
    Few points I can think of:
    1. Try without the ".initialized = true;" property being set
    2. Check if the x & y property values for the ComboBox are valid
    3. Check if any styles are being applied that set the top, right, bottom or left properties thru CSS
    Removing (or alternately adding) the ".initialized = true" doesn't make a difference. It was actually a last ditch effort to try to make it draw it and wasn't meant to stay in the code.
    The x and y property values are valid as far as I know. The code for the positioning and sizing of the combobox was taken from the textfield below which I ended up moving down when I decided to add the combobox. The textfield has always drawn correctly.
    I looked through the CSS and it doesn't appear to set top, right, bottom or left anywhere. The only CSS in the project is from the Degrafa library that I'm using to draw components.
    Michael Borbor wrote:
    What's the val of the variable  width?
    Width is set to 150, which is the width of the Constant component.
    ATIF FAROOQ wrote:
    can you show the hierarchy of your flowchart component
    I'm not 100% sure this is what you mean, but it's:
    Sprite > Graphic (Degrafa class) > GeometryGroup (Degrafa class) > ComponentGroup > Constant
    and just for reference the component's being drawn onto:
    UIComponent > Surface (Degrafa class) > SurfaceComponent

  • Map java.sql.Timestamp to JDBC-MySQL TIMESTAMP?

    Java provides the java.sql.Timestamp class specifically to be able to make
    use of the greater-accuracy timestamps provided in JDBC and underlying
    datastores. Is there a way to set up a Kodo mapping file such that a
    persistent class with a java.sql.Timestamp field, has this field map to a
    TIMESTAMP field in the underlying database table?
    Thanks,
    -- Bryan

    Yes, with a custom field mapping. See the example of a custom field
    mapping for java.sql.Date in samples/ormapping. A mapping for timestamp
    would be almost exactly the same.

  • WebService and ActionScript class

    Hi,
    I am trying to create an actionscript class to use it in my
    mxml component.
    I have the floowing code which works perfectly.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application creationComplete="HTTPdecision.send()"
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="870">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import com.sourcepulse.com.dtRulesClass;
    private var endURI:XML;
    private var URI:XMLList;
    private function setURI(event:ResultEvent):void
    endURI = event.result as XML;
    URI = new XMLList(endURI.endpoint.webservice.location);
    Test.endpointURI= URI.toString();
    ]]>
    </mx:Script>
    <mx:HTTPService id="HTTPdecision"
    url="../XML/endpointURI.xml" resultFormat="e4x"
    result="setURI(event)" />
    <mx:WebService service="amazon" port="amazonSOAP"
    id="Test"
    wsdl="
    http://localhost:9081/ezbuyer/amazon/services/amazonSOAP/wsdl/amazon.wsdl"
    >
    <mx:operation name="getISBNDetails">
    <mx:request xmlns="">
    <isbnSearchRequest>
    <bookName>{txtBookName.text}</bookName>
    <category>{txtCategory.text}</category>
    </isbnSearchRequest>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Panel x="100" y="100" width="600" height="500"
    layout="absolute"
    title="Amazon WebService">
    <mx:VBox height="400">
    <mx:VBox>
    <mx:Form width="400" height="145" autoLayout="true">
    <mx:FormHeading label="Specify the following:"/>
    <mx:FormItem width="307" label="BookName :">
    <mx:TextInput id="txtBookName"/>
    </mx:FormItem>
    <mx:FormItem width="308" label="Category :">
    <mx:TextInput id="txtCategory" />
    </mx:FormItem>
    <mx:FormItem width="312">
    <mx:Button label="Test"
    click="Test.getISBNDetails.send()"/>
    </mx:FormItem>
    </mx:Form>
    </mx:VBox>
    <mx:VBox>
    <mx:Form width="400" height="122" autoLayout="true">
    <mx:FormHeading label="Book Details:"/>
    <mx:FormItem width="307" label="ISBN :">
    <mx:Text text="{Test.getISBNDetails.lastResult.isbn}"
    />
    </mx:FormItem>
    <mx:FormItem width="308" label="Author :">
    <mx:Text text="{Test.getISBNDetails.lastResult.author}"
    />
    </mx:FormItem>
    </mx:Form>
    </mx:VBox>
    </mx:VBox>
    </mx:Panel>
    </mx:Application>
    Now instead of binding the input from the textboxes directly
    as in the above code
    <mx:request xmlns="">
    <isbnSearchRequest>
    <bookName>{txtBookName.text}</bookName>
    <category>{txtCategory.text}</category>
    </isbnSearchRequest>
    </mx:request>
    I created an actionscript class
    package com.xxxx.com
    public class simpleTest
    //Instance Variables
    private var bookName:String;
    private var category:String;
    public function simpleTest()
    function getBookName():String {
    return bookName;
    function setBookName(bookName:String):Void {
    this.bookName = bookName;
    function getCategory():String {
    return category;
    function setCategory(category:String):Void {
    this.category = category;
    How can I use this ActionScript class to use in
    <bookName>{txtBookName.text}</bookName>.
    Thanks in advance.

    I think you're close to achieving what you want... first I
    would change your getter and setter methods just a bit to make them
    properties. Second add the [Bindable] meta tag in front of one of
    each of the group of properties (i.e. you don't need it in front of
    both the get and set method, just one of them).
    i.e.
    [Bindable]
    public function get category():String {
    return category;
    public function set category(value:String):void{
    category = value;
    then in your mxml you can "bind" to each property you've
    defined in the class. so if you create a new instance of your
    simpleTest class called "test" you could do the following:
    <mx:Label text="{test.category}" />

Maybe you are looking for

  • [b]Error during JSP page processing[/b]

    hi , i'm mech. i have some probs with jsp. i am trying to connect jsp page with database and printing the data on the browser page. i have created DSN mm using microsoft odbc for oracle and oracle9i's driver oracle in orahome90 but it is giving yet .

  • Voicemail Not Working (Again)

    I switched to Verizon about a year ago and have had repeated problems with my voicemail failing to work.  I will set it up and it will indicate it is working and then without notice I get an email or phone call from someone that tells me that they ha

  • How to get the actual path of a file present in the Web content folder

    I have a jasper file which is present inside the Web-Content folder of my project. I need to pass this file as an argument to the FileInputStream object. How can i give the actual path of the jasper file, since this project can be deployed anywhere e

  • Google Redirect Virus Removal

    So essentially, it seems that somehow my PC has picked up a version of the Google redirect virus. It is only affecting Firefox, and it seems to be a bit stealthier than previous versions. Essentially, 70% of the time I try and click on a search resul

  • OLE Excel Questions

    Guys, I am working on OLE excel to download data from SAP.I have few basic questions for OLE excel 1. I want to merge Cells in EXCEL , how can i do it? 2. I want to make alignment right in some Cell,how can i do it? 3. I have been reading post in SDN