Web services interoperability - extension of type wsdl

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?

+4
source share
1 answer

The main WS-I profile says the following about xml:

The profile uses the Web Services Description Language (WSDL) to include the description of services as sets of endpoints that work with messages. This profile section includes the following specifications by reference (...): XML Schema Part 1: Structures

Therefore, he refers to the XML schema as what it is based on. There you will find :

Abstract complex types can be used as a {definition of a base type} s or even as a definition of a {type definition} s of element declarations, provided that in each case a definition of a certain derived type is used to verify the correctness; either via xsi: of type (ยง 2.6.1) or the operation of a substitution group.

In addition, it defines the <extension base="QName"> construct, which the document has something to say.

But all this at a conceptual level, not necessarily directly linking it to the inheritance of objects. Although it is probably not so difficult to make such a comparison (and your link shows it exactly), it is also not strictly defined. I think what they talk about when they raise issues.

So technically and syntactically, the design is part of the standard, but the implementation can handle it in unforeseen ways. On the other hand, a tool that adheres to the standard must be able to receive and output valid WS-I XML and perform validation, also specified in the XML standard .

In conclusion, I would say that any tool that cannot handle your design in any way is not a valid WS-I implementation.

+1
source

Source: https://habr.com/ru/post/1436941/


All Articles