You need to sign in to do that
Don't have an account?
sstelutzza
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:
Is there a work-around for this?
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:
Were you ever able to find a work-around? I am having the same problem.
Did you find a workaround or solution for the above problem?