0 Replies Latest reply on Dec 30, 2008 12:54 PM by R.Tapia

    Using derived class in Web Service

    R.Tapia
      I've imported a WSDL using Flex Builder to generate proxies for a simple .NET web service.

      The method I am calling, "SavePerson", takes a single argument of a class called "Person", with a single attribute of "SkinColor", which is a string.

      In the WSDL there are 2 other data types declared, based on "Person", "Asian" & "Caucasian"
      Each have another attribute declared besides the inherited "SkinColor" attribute, both are strings.

      Now, when I call that method using an instance of "Person", everything works fine.

      When I call the method using one of the derived classes, "Caucasian" or "Asian", they are up-casted to the base class "Person" and lose their individual attributes and retain only the inherited property "SkinColor".

      Does anyone know if this is a bug?

      Could this be remedied by changing things in the SOAPEncoder.as file of the RPC lib?

      One thing I have done is tested this in .NET by calling the web service in C#, because this works fine, I wanted to have a look at the .NET constructed SOAP message and see how it differs from the Flex constructed message.

      The only difference that I see that makes things work in .NET is that the "person" argument contains a "type" attribute of xsd:type="Asian" or xsd:type="Caucasian" in the resulting SOAP message being sent.

      Is there a reason that Flex does not add this attribute during the serialization/encoding process?
      Is there a way for me to add or remedy this manually?

      Any help would be gratefully appreciated.

      I also included the chunk of the WSDL that declares the method and data types, if it clarifies anything

      Thanks.