1 Reply Latest reply on Jul 2, 2009 12:40 AM by sri harsha namala

    Flex - Java service - Good architecture

    flexer_noob

      Hello everybody,

      I want to connect a Flex application to my Java services.
      So I tried the "hello world" of GraniteDS:
      http://www.graniteds.org/confluence/pages/viewpage.action?pageId=5668967

      It works perfectly.
      Now, more complicated, I want to use MY services

      So:
      a. I put my jar in lib directory
      b. I update my services-config.xml with a new destination (my service)
      c. I update the HelloWorld.mxml of the example:

      <mx:RemoteObject id="srv" destination="myService" />

      <mx:Panel styleName="Panel" title="Hello World Sample">
      <mx:Label text="Enter your name:"/>
      <mx:TextInput id="nameInput" />
      <mx:Button label="Say Hello" click="srv.myMethod(nameInput.text)"/>
      </mx:Panel>

      I have one very important question:

      myMethod has complex objects in parameters, not a simple String like the
      example. It has in parameter one Java object that I made: "MyMethodRequest" and
      this object has several attribute like login, password, locale and timezone. So
      the question is: how can I call myMethod in Flex (with good param, not
      "nameInput.text" param)? Morevover, I prefer to do that in Proxy.as rather than
      mxml (I use PureMVC architecture)

      If you have the solution, thank you very much!