Monday 15 March 2010

Problem when mapping inheritance in web service for a Flex client -


I have a problem while using the web service from the Flex app. I have a hierarchy in the backend, suppose I have an abstract class There are fruits and 2 implementations: Apple and Orange fruits have a property, name, color of property in apple, and a property radius in Orange. Again, I have a service that gives a collection of fruits when I consume it with Flex, then this collection returns those items which are fruits, with the property of its name; But I lose all the properties for the implementation classes (color or radius). So, the question is, does Flex support mapping legacy while using web services? If not, is there any work? I hope that would be clear enough I know if not thank you. George

Is this a SOAP service implementation? Are you using FlashBuilder "import wsdl" feature, or something else?

You can use Flash Maker to import WSDL and can generate AS classes dynamically. You should have imported derivative classes there. When your data comes, you will need to place the fruit object in their correct child classes. Make sure to check to make sure your WSDL is built properly - I do not know why sending such a collection will cause a problem for Flex.

If you can provide more detailed information on Web Services architecture, please help us get more detailed answers.


No comments:

Post a Comment