Question 010101

Consider the following SOAP message fragment:

					
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
       soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">       
    <soap:Body xmlns:ns1="http://example">
		...            
    </soap:Body>    
</soap:Envelope>				
					
					
Is the message BP 1.0 conformant?

Options (select 1):

  1. Yes, it is comformant for all styles of SOAP messages.

  2. Yes, it is comformant for "rpc-encoded" binding only.

  3. Yes, it is comformant for "document-encoded" binding only.

  4. Yes, it is comformant for "rpc-encoded" and "document-encoded" bindings only.

  5. No, it is not comformant.

Answer:

Correct option is 5.

The soap:encodingStyle attribute is used to indicate the use of a particular scheme in the encoding of data into XML. However, this introduces complexity, as this function can also be served by the use of XML Namespaces. As a result, the Basic Profile prefers the use of literal, non-encoded XML.

R1005 A MESSAGE MUST NOT contain soap:encodingStyle attributes on any of the elements whose namespace name is "http://schemas.xmlsoap.org/soap/envelope/".

R1006 A MESSAGE MUST NOT contain soap:encodingStyle attributes on any element that is a child of soap:Body.

R1007 A MESSAGE described in an rpc-literal binding MUST NOT contain soap:encodingStyle attribute on any elements are grandchildren of soap:Body.

Options 2, 3 and 4 are also wrong because BP 1.0 explicitly prohibits the rpc-encoded and document-encoded modes.

Sources:

Basic Profile Version 1.0 - http://www.ws-i.org/Profiles/BasicProfile-1.0.html

Question 010102

Which of the following WSDL Schema fragments contains a Basic Profile 1.0-conformant array declaration:

Options (select 1):

  1. 		
    <element name="myFavoriteStrings" type="ArrayOfStrings"/>
    					
    <complexType name="ArrayOfStrings"> 
        <complexContent> 
            <restriction base="SOAP-ENC:Array"> 
                <sequence> 
                    <element name="x" type="string" minOccurs="0" maxOccurs="unbounded"/> 
                </sequence> 
                <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> 
            </restriction> 
        </complexContent> 
    </complexType>
    
    								

  2. 
    <element name="myFavoriteStrings" type="MyArrayType"/>
    
    <xsd:complexType name="MyArrayType">
        <xsd:sequence>
            <xsd:element name="x" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/> 
    </xsd:complexType>
    								
    								

  3. 
    <element name="myFavoriteStrings" type="MyArrayType"/>
    
    <xsd:complexType name="MyArrayType">
        <xsd:sequence>
            <xsd:element name="x" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    								
    								

  4. 							
    <element name="myFavoriteStrings" type="ArrayOfStrings"/>
    
    <complexType name="ArrayOfStrings"> 
        <complexContent> 
            <restriction base="SOAP-ENC:Array"> 
                <sequence> 
                    <element name="x" type="string" minOccurs="0" maxOccurs="unbounded"/> 
                </sequence> 
            </restriction> 
        </complexContent> 
    </complexType>
    
    								

Answer:

Correct option is 3.

The recommendations in WSDL 1.1 Section 2.2 for declaration of array types have been interpreted in various ways, leading to interoperability problems. Further, there are other clearer ways to declare arrays.

R2110 In a DESCRIPTION, array declarations MUST NOT extend or restrict the soapenc:Array type.

This means options 1 and 4 are wrong.

R2111 In a DESCRIPTION, array declarations MUST NOT use wsdl:arrayType attribute in the type declaration.

This means option 1 and 2 are wrong.

R2112 In a DESCRIPTION, array declaration wrapper elements SHOULD NOT be named using the convention ArrayOfXXX.

Options 1 and 4 violate this requirement.

R2113 A MESSAGE containing serialized arrays MUST NOT include the soapenc:arrayType attribute

Sources:

Basic Profile Version 1.0 - http://www.ws-i.org/Profiles/BasicProfile-1.0.html