can someone please tell me whitch of these xsd parts (xsd1 or xsd2) is valid for sample code below:
Class definitions:
class A
{
int prop1;
int prop2;
}
class B : A {}
So, class A is base class and class B inherit A and have no aditional properties.
xsd1: In this case if I use wsimport to generate code from wsdl file that contains this part of xsd I will get generated code for all elements, A and B. But, if I use svcutil I will get generated only class A.
<xs:element name="B" nillable="true" type="tns:A" />
<xs:complexType name="A">
<xs:sequence>
<xs:element name="prop1" type="xs:string"/>
<xs:element name="prop2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="A" nillable="true" type="tns:A" />
xsd1: In this case both wsimport and svcutil will generate all elements, A and B.
<xs:complexType name="B">
<xs:complexContent mixed="false">
<xs:extension base="tns:A">
<xs:sequence />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="B" nillable="true" type="tns:A" />
<xs:complexType name="A">
<xs:sequence>
<xs:element name="prop1" type="xs:string"/>
<xs:element name="prop2" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="A" nillable="true" type="tns:A" />
So, my question is ... is this first definition valid?