function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sstelutzzasstelutzza 

Why polymorphism with web services is not working right?

I have developed a web service in java and then tried to crate an apex client to invoke my web service, but I have encountered the following problems:

1) In my wsdl a have a class hierarchy likes this:
<complexType name="Column1">
                <complexContent>
                    <extension base="sns:Column">
                        ......
                    </extension>
                </complexContent>
            </complexType>
When generating classes using wsdl2apex, there is no relation between Column1 and Column.
When generating java classes from the same wsdl Column1 extends Column.
Why wsdl2apex doesn’t generate the relation between Column1 and Column? 2)I have generated  apex classes from wsdl, and then I have manually put  extends(Column1 extends Column) public virtual class Column {        public  String name;       ……….. } public class Column1 extends Column{   public Integer length;    ……………………………………………………………….}  the service method should return an object witch contains a list of columns Structure getStructure(){Return an object  of type Column[] } If some of the elements of Column[] object, returned when invoking the web service  are  Of type Column1,  an error occurs : :58:20.883|FATAL_ERROR|System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element =length I wanted to obtain the list of columns and then cast them to the specific subclass.  3)If in my wsdl I have the type "xsd:anyType" , when trying to generate apex classes using wsdl2apex the following message is displayed:

Error message:
Error: Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType

Is there a work-around for this? 
NathanSNathanS

Were you ever able to find a work-around? I am having the same problem.

Imran MohammedImran Mohammed

Did you  find a workaround or solution for the above problem?