I believe this is a known bug in Beta 2 that we've fixed in B3.  Sorry,
I'm not sure of a workaround right now...

Matt

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of yomahz
Sent: Friday, April 28, 2006 8:34 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Problems with Flex2 serializing ActionScript
objects to SOAP elements

When serializing ActionScript objects to XML, it does not appear that
Flex is properly ordering the elements according the order defined in
the WSDL. For instance, I have a WSDL with a complext type defined as
such:

<complexType name='SoapInventory'>
<sequence>
   <element name='id' nillable='true' type='int'/>
   <element name='inventoryDate' nillable='true' type='dateTime'/>
   <element name='label' nillable='true' type='string'/>
   <element maxOccurs='unbounded' minOccurs='0' name='locations'
nillable='true' type='ns2:SoapInventoryLocation'/>
   <element name='storeId' nillable='true' type='int'/>
   <element name='type' nillable='true' type='string'/>
</sequence>
</complexType>

I also have a ActionScript object defined as:

package com.mycompany.myapp.inventory.model {
  public class SoapInventory {
    public var id:int;
    public var inventoryDate:Date;
    public var label:String;
    public var locations:Array;
    public var storeId:int;
    public var type:String;
  }
}

Flex serializes this object as:

<SoapInventory_1>
<ns1:storeId>1012</ns1:storeId>
<ns1:type xsi:nil='true'/>
<ns1:label>Test</ns1:label>
<ns1:id>123</ns1:id>
<ns1:inventoryDate>2006-04-27T20:52:12.129Z</ns1:inventoryDate>
</SoapInventory_1>

Which is not the order defined in the WSDL's sequence. Am I doing
something incorrectly or have I missed something? Here's how I'm
calling the webservice:


ws = new mx.rpc.soap.WebService();
ws.wsdl = "http://localhost:8080/test/InventoryWebService?wsdl";
ws.save.addEventListener("result", handleSave);
ws.addEventListener("fault", handleFault);
ws.loadWSDL();
ws.save(soapInventory);







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








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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to