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

9642RE: [soapbuilders] Element having minOccurs=0 and nillable=true

Expand Messages
  • Dinesh Shahane
    Dec 8, 2003
      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
      -----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


      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.



      This group is a forum for builders of SOAP implementations to discuss implementation and interoperability issues.  Please stay on-topic.

      To unsubscribe from this group, send an email to:

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    • Show all 6 messages in this topic