Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to pass complex data type structure to WebService under mx:request?

Avatar

Avatar
Level 1
wzxie
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
wzxie
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
wzxie
Level 1

14-05-2009

From my Flex client, I need to pass data to a web service whose operation expects a complex data type with multiple layers of nesting structure. How can I populate the <mx:request> for the <mx:WebServices>? Any examples?

A couple of approaches come to my mind:

(1) construct ActionScript object to mimic the datatype expected by web service, and pass an instance of the AS object to mx:request; or
(2) construct an entire SOAP request body in XML and pass it into mx:request.

Does any of these (or both) work? If both work, which is the better way?

Thanks in advance for your input!

-William

Replies

Avatar

Avatar
Boost 5
Employee
MarcelBoucher
Employee

Likes

9 likes

Total Posts

44 posts

Correct Reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile

Avatar
Boost 5
Employee
MarcelBoucher
Employee

Likes

9 likes

Total Posts

44 posts

Correct Reply

4 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile
MarcelBoucher
Employee

14-05-2009

William,

Option 1!!! For sure.

Option 2 will just give you a headache

Avatar

Avatar
Level 1
wzxie
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
wzxie
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
wzxie
Level 1

14-05-2009

Thanks a lot for the rapid response, Marcel.

For further details on the maping between WS complexType structure and AS object, is there any specific requirement? such as naming, binding, structure of nesting, etc.

William