My web service knowledge has gotten a little rusty, but here's two
things to try:

1. Make sure there's nothing in the WSDL definition for this service
that would cause this to happen.  What would cause this in the WSDL is
better answered by someone who isn't rusty in this area.  :)
2. I'm not sure if this is needed, but try this before sending things, a
hidden setting that has to deal with SOAP arrays:
myWS.stub.xmlEncoderConfig = new XMLEncoderConfig();
myWS.stub.xmlEncoderConfig.useSOAPEncoding = true;

-Brian

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of zipo13
Sent: Sunday, July 31, 2005 2:27 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] sending typed arrays over web services

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?









--
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



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hokbhjc/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1122847401/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy</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