Loading ...
Sorry, an error occurred while loading the content.

9641Element having minOccurs=0 and nillable=true

Expand Messages
  • bryondonahue
    Dec 8 6:38 AM

      I'm experiencing an interoperability problem related to minOccurs=0
      and nillable=true. Suppose I have the following associated with a
      doc/lit WSDL:

      <s:complexType name="echoMeStructRequest">
      <s:element minOccurs="0" nillable="true" maxOccurs="1"
      name="varString" type="s:string" />
      <s:element minOccurs="0" nillable="true" maxOccurs="1"
      name="varInt" type="s:int" />
      <s:element minOccurs="0" nillable="true" maxOccurs="1"
      name="varFloat" type="s:float" />
      <s:element name="theStruct" type="tns:echoMeStructRequest" />

      Now suppose I must send theStruct in a SOAP message and varString has
      no value. The question is what should be sent on the wire?

      Is it valid not to send the varString tag, due to minOccurs="0"? Or,
      does nillable="true" require that the varString be present with the
      attribute xsi:nill="true"? Or, are both forms acceptable?

      I have one product that, when there is no value, requires the tag on
      the wire with xsi:nil="true" and always puts this tag on the wire. I
      have another product that can consume either form but, when emitting
      messages, does not, by default, put the tag on the wire; but
      interestingly, if the programmer calls a Java Bean setter and passes
      null (example theStruct.setVarString(null)), the product will then
      put the varString tag on the wire with xsi:nill="true".

      Can you folks provide insight and reasoning as to to what should be
      on the wire? Note that I have examined the archive and your test
      suites; it appears this issue has not been addressed.


    • Show all 6 messages in this topic