Hi Ben,

 

I do the following to achieve this.

 

Let’s say I have a Customer who can have multiple Address objects. Compare Customer with your SelectedPlans and Address with PlanNumber.

 

My Customer AS class looks like this (boring parts omitted)

 

package model {

 

      <your imports ...>

     

      public class Customer

      {

            <your other attributes>

            public var addresses:Array = new Array();

 

            <and the rest ...

 

The Address AS class is nothing more than this:

 

package model {

 

      <your imports ...>

     

      public class Address {

            public var street:String;

            public var houseNumber:int = 0;

 

            <... you get the idea>

 

To store multiple Address objects into the Customer object, you just fill the array ‘addresses’ with Address objects.

 

You can now throw the entire Customer object as single argument into your webservice call. Flex will unmarshal the array correctly and generate the XML as you describe below.

 

Hope this helps,

Cheers,

Franck

 

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of ben.clinkinbeard
Sent: Monday, August 07, 2006 3:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Web Service arguments in AS - how do you create repeated children?

 

Hello, I am sending arguments to my SOAP method, but can't figure out
how to do repeated children in AS. For example, part of my call looks
like this in XML:

<SelectedPlans>
<PlanNumber>12345</PlanNumber>
<PlanNumber>56789</PlanNumber>
</SelectedPlans>

I cannot figure out how to create this structure in AS. It seems that
I have to use an Object (args.SelectedPlans = new Object();) in order
for the name to be preserved during the conversion to XML, but objects
obviously can't have 2 properties with the same name.

Does anyone know how to do this?

Thanks,
Ben

__._,_.___

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