Retriving Inherited Objects in an Array

Retriving Inherited Objects in an Array

Post by YnJpYW4ubW » Thu, 13 Jan 2005 07:07:01


have a web service in a technology called Jade. It is returning a
StudentObject, which has an array of Application Objects on it. The
Application objects never are actually Application Instances, they are always
inherited types. eg.

public class Student
{
public Application[] allApplications;
}
public class Application
public class ApplicationType1 : Application
public class ApplicationType2 : Application

When the Jade web service returns these paramaters. It returns it as
follows. Which seems correct. I also created a .Net version which returns the
same thing. When .Net recieves the XML from the Jade web service it complains
that it cant put a AppliationType1 in and array of type Application[] has
anyone had this problem before? In both cases the inherited types are defined
in the WSDL file and do inherit from the Application Class. The .Net version
works fine. It can deal with the inherited type so it isnt that it cant do
it, just that something is wrong.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="urn:JadeWebServices/WebService/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:types="urn:JadeWebServices/WebService/encodedTypes">
<soap:Header soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<types:JadeSessionHeader xsi:type="types:JadeSessionHeader">
<sessionId>9a11545874af0dc4</sessionId>
</types:JadeSessionHeader>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<types:getSetStudentResponse>
<pStudent href="#Student339"/>
</types:getSetStudentResponse>
<types:Student id="Student339" xsi:type="types:Student">
<birthDate>1978-01-01</birthDate>
<familyName>Ty</familyName>
<givenNames>Indo</givenNames>
<allApplications xsi:type="soapenc:Array"
soapenc:arrayType="types:HobApplication[1]">
<HobApplication xsi:type="UnderGraduateApplication">
<applicationId>50</applicationId>
<arrivalDate>1900-01-01</arrivalDate>
<assessPreferenceNo>1</assessPreferenceNo>
<myApplicationType>
<name>Undergraduate</name>
<oid>3788.133</oid>
<value>Undergraduate</value>
</myApplicationType>
</HobApplication>
</allApplications>
</types:Student>
</soap:Body>
</soap:Envelope>

The .Net version returns this
<?xml version="1.0" encoding="utf-8"?>
<Student xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
<firstName_>Indo</firstName_>
<lastName_>Ty</lastName_>
<allApplications>
<HobApplication xsi:type="UnderGraduateApplication">
<arrivalDestination>Melbourne</arrivalDestination>
<assessPreferenceNo>2</assessPreferenceNo>
<commencementYear>2005</commencementYear>
<applicationsID>0</applicationsID>
<ApplicationType>Undergraduate</ApplicationType>
</HobApplication>
</allApplications>
<