Declaring array types and instances to comply with WS-I basic profile 1.0 |
 |
EXPERT RESPONSE FROM: Daniel Foody

|
 |
|
| > |
QUESTION POSED ON: 27 January 2004
SOAP 1.1 (section 5) encoding described a method to encode arrays which WSDL 1.1 (section 2.2) added upon for array declarations. Both methods were proscribed in WS-I basic profile 1.0 (requirements R2110 - R2113). The question is then how do you declare an array type (in a WSDL document) and represent an array instance (in a SOAP message) in line with the new requirements from WS-I?
|
|
| > |
One of the observations during the development of the WS-I basic profile was that the SOAP encoding style, due to its lack of clarity, was the root of a large number of interoperability issues. It would have been too complicated to go back and try and repair the SOAP encoding style -- especially when there was already a widely accepted and unambiguous way to describe the precise structure of an XML document: XSD (the "literal" encoding style in SOAP and WSDL). So, a large number of requirements in the WS-I basic profile are there to make sure that regular XSD is used instead of the SOAP encoding style -- this is the case with the non-mandatory ("should" rather than "must") section of the WSDL spec you are referring to. In this case, the WS-I is basically saying "don't do
what the WSDL spec recommends because it's not interoperable".
As part of section 5.2.3 of the WS-I basic profile, there is an example showing of the right way to encode an array. Basically, you just use standard XSD "minOccurs" and "maxOccurs" on an element declaration to represent an array. If you, in addition, want to define a specific reuseable type for that array, you create a complex type containing a sequence containing the repeating element.
The one important thing not shown in the section 5.2.3 WS-I example is that the SOAP message elements themselves can contain "xsd:type" attributes to identify the type of an element. This is important in cases where the array may be polymorphic -- containing instances of different subtypes of the declared type.
|
|
|
');
// -->

|
|
 |

 |
 |
Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and
answer pairs from more than 250 TechTarget industry experts.
|
 |
 |
 |
|
 |
 |
 |
|
 |
|
 |