Hi,
In my app we are sending complex objects back and forth from flex to
a web service.

The problems is that when an array is inside an object, the objects
inside it are typed as anyType and can't be deserialized on the server.

I'll explain:
If I have a class called Class1 and a container of it Cont and I do

var myObj:Cont = new Cont;
var myArr:Array = new Array();
var myCls1:Class1 = new Class1;
var myCls2:Class1 = new Class1;
myArr.push(myCls1);
myArr.push(myCls2);
myObj.arr = myArr;

myWS.myMethod(myObj,myArr).send();

as you can see I set the array in an object, an then I sent it in the
object and all by itself.
If I look at what flex is sending I see:
-----------------------------------------------------------
<arg1 xmlns:ns2="someNamespace" xsi:type="ns2:myObj">
   <arr xmlns:ns9="http://www.w3.org/1999/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
soapenc:arrayType="ns9:anyType[2]" xsi:type="soapenc:Array">
               <item xsi:type="ns9:anyType">
                  
               </item>
               <item xsi:type="ns9:anyType">
                  
               </item>
   </arr>
            
</arg1>
<arg2 xmlns:ns14="someNamespace" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
soapenc:arrayType="ns14:Class1[2]" xsi:type="soapenc:Array">
        <item xsi:type="ns14:Class1">
        </item>
        <item xsi:type="ns14:Class1">
        </item>     
</arg2 >

-----------------------------------------------------------
So when the array is sent inside another object then the objects in
the array are typed as anyType but when the array is sent as an
argument then the object inside it are typed correctly (as Class1 in
this case).

Does anybody know why is this and how to get the array to be well
typed?








------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hfl35mc/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122804966/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to