Say we have a web service using extensions such as WSDL. Consider an example (valid WSDL) where the Vechicle is abstract. Two types, Car and Bike , inherit from it:
<xs:complexType name="Vehicle" abstract="true"> <xs:sequence> <xs:element name="common1" type="xs:string" minOccurs="0"/> <xs:element name="common2" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="Car"> <xs:complexContent> <xs:extension base="tns:Vehicle"> <xs:sequence> <xs:element name="carValue1" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:extension> </xs:complexContent> <xs:complexType name="Bike"> <xs:complexContent> <xs:extension base="tns:Vehicle"> <xs:sequence> <xs:element name="bikeValue1" type="xs:string" minOccurs="0"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
and the Transport type, which uses the Vehicle type as one of its elements:
<xs:complexType name="Transport"> <xs:sequence> <xs:choice> <xs:element ref="tns:Car"/> <xs:element ref="tns:Bike"/> </xs:choice> <xs:element name="description" type="xs:string"/> </xs:sequence> </xs:complexType>
Note that Vehicle itself is not a possible type inside Transport , and that is, of course, because Vehicle is abstract. It's pretty easy to create a higher stack in Java Metro. Blaise Doughan blogs gave me valuable input here.
My question is how this will work in terms of web services interaction, in particular with regard to the WS-I Basic Profile . Can I be sure that WS-I compatible web services can use such a web service? . I understand that WS-I basically only defines what is allowed in the WSDL as such. I tried reading the WS-I specifications to understand this problem, but did not have real luck. For me, the language is too hard. I found an article since 2004 that causes some problems:
The main reason for this problem is that using the extension mechanism for inheriting value objects is outside the main WS-I profile, although it is not specifically excluded. There is currently no mention of the use of the extension construct in the WS-I base profile, and furthermore, the WS-I compliance test suite does not cover this case.
... but that was in 2004 and is clearly related to the WS-I Basic Profile v1.0. Since then, the WS-I Basic 1.1, 1.2, and 2.0 specifications have been released.
So the question is: will web services using the extension function of the WSDL value type (i.e. <xs:complexType name="xxx" abstract="true"> and <xs:extension base="xxx"> ) work in all frames that claim to be WS-I Main Profile ? Can they use such a web service?