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.
Dig Deeper on Service-oriented architecture (SOA)
Related Q&A from Daniel Foody
Daniel Foody defines end-to-end security and discusses the different parts of security to consider. Continue Reading
Dan Foody discusses the capability of using Web services for ASP applications. Continue Reading
Daniel Foody discusses the "find-bind-execute" paradigm and secure service directories. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.