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

9644Re: Element having minOccurs=0 and nillable=true

Expand Messages
  • bryondonahue
    Dec 8 12:58 PM

      Thanks for the reply. There are a number of work arounds and we have
      already worked around this problem. My purpose for raising this issue
      in this forum is to get you folks thinking about this problem. IMO
      this is a problem that needs further attention and clarification,
      perhaps in WS-I?

      On the surface I agree with your statements, but I am not really
      satisfied. If I have an element with nillable=true and minOccurs=0
      and there is no value, is the element nil or not present? I guess I
      can understand the distinction between these two conditions if one is
      working at the XML level and can explicitly set the XML value and has
      some rules for distinguishing between these conditions.

      But, as you know, in WS toolkits, folks don't work at the XML level,
      they work at the programming model level and it seems that the
      programming models have different assumptions. I guess you could
      argue that in a SOAP Message both "no value" and xsi:nil=true are
      valid and it is the programming models responsibility to distinguish
      between these conditions, if this distinction is necessary.

      Most programming models do not, however, distinguish between "not
      present" and nil (ex: JAX-RPC) and work in the context of their
      assumptions. It seems that it is important to somehow specify the
      valid wire representations in this case and communicate them to the
      toolkit vendors. If this does not happen, we will be fighting this
      problem for a long time.

      Based on this experience, I have already changed our corporate best
      practice to disallow the use of nillable=true in WSDL. I hate to do
      this, but we don't want to deal with problems of this nature; we kind
      of hope that you folks and WS-I will deal with them for us.

      Additionally, I have contacted our suppliers and asked them to clean
      up their act.

      Thanks again. I appreciate the good work that you and others are
      doing here.


      --- In soapbuilders@yahoogroups.com, Wes Moulder <wes@w...> wrote:
      > Present and having no value is distinctly different from nilled
      > 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
      > transmitted array territory of having optional and omitted as
      > "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,
      > 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
      > abstraction.
      > One thing for Byron: there are still tools out there that don't
      > 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
      > --Wes
      > 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
      > > 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
      > > programming platform. Pure XML tools should let you choose the
      form you
      > > like.
      > >
      > > Dinesh
      > >
      > > -----Original Message-----
      > > *From:* bryondonahue [mailto:bryondonahue@y...]
      > > *Sent:* Monday, December 08, 2003 6:38 AM
      > > *To:* soapbuilders@yahoogroups.com
      > > *Subject:* [soapbuilders] Element having minOccurs=0 and
      > >
      > > Folks,
      > >
      > > I'm experiencing an interoperability problem related to
      > > 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
      > > messages, does not, by default, put the tag on the wire; but
      > > interestingly, if the programmer calls a Java Bean setter and
      > > null (example theStruct.setVarString(null)), the product will
      > > 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
      > > suites; it appears this issue has not been addressed.
      > >
      > > Thanks,
      > >
      > > Bryon
      > > AT&T
      > >
      > >
    • Show all 6 messages in this topic