Hi all,

when a string element in a response object is declared with nillable="true" and 
minOccurs="1" in the WSDL,
but the element is not explicitly initialized to null in the service 
implementation code, the element
is not included in the response message (violating the WSDL). Expected: 
xsi:nil="1". 
Is this a bug, or am I missing something? For details see below.

Thanks,
Nenad Jovanovic


WSDL snippet:

    <!-- this container is used as return type of a web service function -->
    <xs:complexType name="Container">
        <xs:sequence>
            <!-- this element will be initialized explicitly with null for test 
purposes -->
            <xs:element minOccurs="0" name="myString1" nillable="true" 
type="xs:string"/>
            <!-- this element will NOT be initialized explicitly; expected 
return: xsi:nil="1" -->
            <xs:element minOccurs="1" name="myString2" nillable="true" 
type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

Code generation parameters in the Ant buildfile:

        <arg line="-uri ${wsdl.uri}"/>
        <arg line="-o ${build.dir}/service"/>
        <arg line="-ss"/>
        <arg line="-sd"/>
        <arg line="-s"/>
        <arg line="-Euwc"/>
        <arg line="-Eosv"/>
        <arg line="-ssi"/>
        <arg line="-uw"/>

SOAP response snippet:

      <ns2:getContainerResponse xmlns:ns2="http://foo.bar";>
         <ns2:return>
            <ns1:myString1 xmlns:ns1="http://foo.bar/xsd";>s1</ns1:myString1>
            <!-- no myString2 element here, even though the WSDL promised it -->
         </ns2:return>
      </ns2:getContainerResponse>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to