Expand my Community achievements bar.

How to send complex object through webservice in Flex 3 to .Net

Avatar

Level 1

Hi,

I am new to Flex and trying to pass a complex object(a object which have another object array collection as property) through Flex 3 to .Net WCF service. I tried all mean but no success. I can successfully send simple object but when trying to send complex object it throw error like "Server request error".

Please reply with sample code to pass complex object. I tried with both by importing webservice using Import Web service of Flex 3 and creating <mx:Webservice> object both way but could not get success.

Thanks in advance for help!!!!!!

Chandra

3 Replies

Avatar

Level 1

Hi Chandra,

Can you give us some code for your webservice that you've created?  I've done this with multiple complex objects through flex3 and webservices with .net.  Should be pretty straight forward.

Avatar

Level 1

Kevin,

My object base class is Abstract and class I am using in Flex 3 is class inheriting abstract class. But when calling webservice Flex creating soap message of base class and I am getting error in .Net web services that "Can not create instance of Abstract class".

Below is the soap message difference calling same WCF method from .Net and Flex. For example Constraint is the base class and JobConstraint is the class which inherit Constraint class. But flex send message forming only Constraint while .Net soap is specifying i:type="JobConstraint".

Part of soap message Calling from .Net

<

Constraints>

<

Constraint i:type="JobConstraint">

<Position

>true</Position>

<

Rank>2</Rank>

<

Requirement>true</Requirement>

</

Constraint>

</

Constraints>

Part of Soap message calling from Flex 3

<ns0:Constraints>
<ns0:Constraint>
<ns0:Position>true</ns0:Position>
<ns0:Rank>2</ns0:Rank>
<ns0:Requirement>true</ns0:Requirement>
</ns0:Constraint>
</ns0:Constraints>

Avatar

Level 1

Hi,

Try this hope you will get your solution here action script class is attached too there.

http://groups.adobe.com/posts/2cbd4ef98b

Thanks

Sanjeev