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

9643Re: [soapbuilders] Element having minOccurs=0 and nillable=true

Expand Messages
  • Wes Moulder
    Dec 8, 2003
    • 0 Attachment
      Present and having no value is distinctly different from nilled out.
      Think of it in terms of your programming language of choice: "" vs
      null. As far as a data model goes, there is no difference between
      optional versus nillable, unless you want to go into the whole partially
      transmitted array territory of having optional and omitted as meaning
      "leave the value as it was before", but that gets into the whole mess of
      assuming aspects of the data model on the other side. Given that, then,
      I'd expect explicitly nilled values would react the same as omitted
      values (IE: both would map to a null value in your higher layer of

      One thing for Byron: there are still tools out there that don't handle
      minOccurs=0 very well. is it possible to try the WSDL without the
      nillable="true", and see if it works that way with an optional value?


      Dinesh Shahane wrote:

      > IMO Both forms of the XML should be accepted. If the element
      > <varString> is present and has no value, it should look for xsi:nil
      > attribute before generating an error.
      > If the element is not sent, it should still accept it due to
      > "minOccurs" constraint. Probably the tools generating the SOAP are not
      > capable of understanding the difference between "optional" and
      > "nillable", this may be due to the lack of these concepts in the base
      > programming platform. Pure XML tools should let you choose the form you
      > like.
      > Dinesh
      > -----Original Message-----
      > *From:* bryondonahue [mailto:bryondonahue@...]
      > *Sent:* Monday, December 08, 2003 6:38 AM
      > *To:* soapbuilders@yahoogroups.com
      > *Subject:* [soapbuilders] Element having minOccurs=0 and nillable=true
      > Folks,
      > 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:sequence>
      > <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:sequence>
      > </s:complexType>
      > <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.
      > Thanks,
      > Bryon
      > AT&T
    • Show all 6 messages in this topic