0 Replies Latest reply on Aug 28, 2006 7:38 AM by boliz

    passing comlex type from WS to flex

    boliz
      Hey!

      i stuck with my project!! i am working with WS that have a complex object, i tryed to construct in flex the same obj as a class and to send it to the WS and get the response, the calss i made in flex is here:

      package javaobject
      {
      [Bindable]
      [RemoteClass(alias="javaobject.GetNavigationTreeRequest")]
      public class GetNavigationTreeRequest
      {
      import javaobject.KeyValueEntry;

      private var _aggregateCollection:Boolean;

      private var _environment:KeyValueEntry;

      private var _lastModification:Date;

      private var _nodeAdditionalParams:Array;

      private var _numberOfLevels:Number;

      private var _requiredCollections:Array;

      private var _rootNodeId:String;

      // Define public getter.
      public function get aggregateCollection():Boolean
      {
      return _aggregateCollection;
      }

      // Define public setter.
      public function set aggregateCollection(value:Boolean):void
      {
      _aggregateCollection = value;
      }

      // Define public getter.
      public function get environment():KeyValueEntry
      {
      return _environment;
      }

      // Define public setter.
      public function set environment(value:KeyValueEntry):void
      {
      _environment = value;
      }

      // Define public getter.
      public function get lastModification():Date
      {
      return _lastModification;
      }

      // Define public setter.
      public function set lastModification(value:Date):void
      {
      _lastModification = value;
      }

      // Define public getter.
      public function get nodeAdditionalParams():Array
      {
      return _nodeAdditionalParams;
      }

      // Define public setter.
      public function set nodeAdditionalParams(value:Array):void
      {
      _nodeAdditionalParams = value;
      }

      // Define public getter.
      public function get numberOfLevels():Number
      {
      return _numberOfLevels;
      }

      // Define public setter.
      public function set numberOfLevels(value:Number):void
      {
      _numberOfLevels = value;
      }

      // Define public getter.
      public function get requiredCollections():Array
      {
      return _requiredCollections;
      }

      // Define public setter.
      public function set requiredCollections(value:Array):void
      {
      _requiredCollections = value;
      }

      // Define public getter.
      public function get rootNodeId():String
      {
      return _rootNodeId;
      }

      // Define public setter.
      public function set rootNodeId(value:String):void
      {
      _rootNodeId = value;
      }
      }
      }

      the parallel java class is
      public class GetNavigationTreeRequest implements java.io.Serializable {
      private boolean aggregateCollection;

      private com.sap.test11.KeyValueEntry[] environment;

      private java.util.Calendar lastModification;

      private java.lang.String[] nodeAdditionalParams;

      private int numberOfLevels;

      private java.lang.String[] requiredCollections;

      private java.lang.String rootNodeId;
      ...

      now when i try wsNav.getNavigationTree.send() i get this error RPC Fault faultString="Error #1069: Property aggregateCollection not found on String and there is no default value." faultCode="EncodingError" faultDetail="null"]

      what i do worng? how i can pass this complex object? with no errors and get the rsponse?

      i need your help!!