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

MSTK2 and null

Expand Messages
  • mbalsara@yahoo.com
    Hi I sent the following message to echoStringArray:
    Message 1 of 16 , Mar 31, 2001
      Hi

      I sent the following message to echoStringArray:

      <SOAP-ENV:Envelope xmlns:SOAP-
      ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <m:echoStringArray xmlns:m="http://soapinterop.org/">
      <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
      <item xsi:type="xsd:string">one</item>
      <item xsi:type="xsd:string">two</item>
      <item xsi:null="1" />
      <item xsi:type="xsd:string">three</item>
      </inputStringArray>
      </m:echoStringArray>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      The item 3 in the array is null, with attribute xsi:null="1"

      The third item in the response was, witout the null attribute:
      <?xml version="1.0" standalone="no" ?>
      <SOAP-ENV:Envelope SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
      <SOAP-ENV:Body>
      <m:echoStringArrayResponse xmlns:m="http://soapinterop.org/">
      <Result xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
      xmlns:SOAPSDK2="http://schemas.xmlsoap.org/soap/encoding/"
      SOAPSDK2:arrayType="SOAPSDK1:string[4]"
      xmlns:SOAPSDK3="http://www.w3.org/2001/XMLSchema-instance">
      <SOAPSDK1:string>one</SOAPSDK1:string>
      <SOAPSDK1:string>two</SOAPSDK1:string>
      <SOAPSDK1:string />
      <SOAPSDK1:string>three</SOAPSDK1:string>
      </Result>
      </m:echoStringArrayResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>


      Is this a bug or am I doing something wrong?

      thanks
      manish
    • Fredrik Lundh
      ... but in the array declaration, you telling the receiver that you re sending four strings. (null != empty string) Cheers /F
      Message 2 of 16 , Apr 1 1:52 AM
        manish wrote:

        > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
        > <item xsi:type="xsd:string">one</item>
        > <item xsi:type="xsd:string">two</item>
        > <item xsi:null="1" />
        > <item xsi:type="xsd:string">three</item>
        > </inputStringArray>
        > </m:echoStringArray>
        > </SOAP-ENV:Body>
        > </SOAP-ENV:Envelope>
        >
        > The item 3 in the array is null, with attribute xsi:null="1"

        but in the array declaration, you telling the receiver
        that you're sending four strings.

        (null != empty string)

        Cheers /F
      • mbalsara@yahoo.com
        ... I am sending four strings, and the third item is: and the response I get back is: I was expecting a response
        Message 3 of 16 , Apr 1 7:54 AM
          --- In soapbuilders@y..., "Fredrik Lundh" <fredrik@p...> wrote:
          > manish wrote:
          >
          > > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
          > > <item xsi:type="xsd:string">one</item>
          > > <item xsi:type="xsd:string">two</item>
          > > <item xsi:null="1" />
          > > <item xsi:type="xsd:string">three</item>
          > > </inputStringArray>
          > > </m:echoStringArray>
          > > </SOAP-ENV:Body>
          > > </SOAP-ENV:Envelope>
          > >
          > > The item 3 in the array is null, with attribute xsi:null="1"
          >
          > but in the array declaration, you telling the receiver
          > that you're sending four strings.
          >
          > (null != empty string)

          I am sending four strings, and the third item is:

          <item xsi:null="1" />

          and the response I get back is:
          <SOAPSDK1:string />

          I was expecting a response which indicated the item is null, rather
          than empty string.

          manish
        • Fredrik Lundh
          ... interesting. why were you expecting that? what part of the SOAP specification made you think it would work like this? (to me, your request looks
          Message 4 of 16 , Apr 1 8:20 AM
            manish wrote:

            > I was expecting a response which indicated the item is null, rather
            > than empty string

            interesting. why were you expecting that? what part of the
            SOAP specification made you think it would work like this?

            (to me, your request looks malformed. if it had been a struct instead
            of an array, that null element could have meant "use default". I can't
            find anything that supports your expectations, but I might be missing
            something...)

            Cheers /F
          • Mike Deem
            We don t have null support yet. == Mike == ... From: mbalsara@yahoo.com [mailto:mbalsara@yahoo.com] Sent: Saturday, March 31, 2001 10:33 PM To:
            Message 5 of 16 , Apr 1 8:20 AM
              We don't have null support yet.

              == Mike ==

              -----Original Message-----
              From: mbalsara@... [mailto:mbalsara@...]
              Sent: Saturday, March 31, 2001 10:33 PM
              To: soapbuilders@yahoogroups.com
              Subject: [soapbuilders] MSTK2 and null


              Hi

              I sent the following message to echoStringArray:

              <SOAP-ENV:Envelope xmlns:SOAP-
              ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-
              ENC="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-
              ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
              <SOAP-ENV:Body>
              <m:echoStringArray xmlns:m="http://soapinterop.org/">
              <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
              <item xsi:type="xsd:string">one</item>
              <item xsi:type="xsd:string">two</item>
              <item xsi:null="1" />
              <item xsi:type="xsd:string">three</item>
              </inputStringArray>
              </m:echoStringArray>
              </SOAP-ENV:Body>
              </SOAP-ENV:Envelope>

              The item 3 in the array is null, with attribute xsi:null="1"

              The third item in the response was, witout the null attribute:
              <?xml version="1.0" standalone="no" ?>
              <SOAP-ENV:Envelope SOAP-
              ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
              xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
              <SOAP-ENV:Body>
              <m:echoStringArrayResponse xmlns:m="http://soapinterop.org/">
              <Result xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
              xmlns:SOAPSDK2="http://schemas.xmlsoap.org/soap/encoding/"
              SOAPSDK2:arrayType="SOAPSDK1:string[4]"
              xmlns:SOAPSDK3="http://www.w3.org/2001/XMLSchema-instance">
              <SOAPSDK1:string>one</SOAPSDK1:string>
              <SOAPSDK1:string>two</SOAPSDK1:string>
              <SOAPSDK1:string />
              <SOAPSDK1:string>three</SOAPSDK1:string>
              </Result>
              </m:echoStringArrayResponse>
              </SOAP-ENV:Body>
              </SOAP-ENV:Envelope>


              Is this a bug or am I doing something wrong?

              thanks
              manish




              To unsubscribe from this group, send an email to:
              soapbuilders-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to
              http://docs.yahoo.com/info/terms/
            • Paul Kulchenko
              Hi, Frederic! ... Exactly. It should return null. As far as I understand null could be ANY element and null should be returned. .pl
              Message 6 of 16 , Apr 1 8:25 AM
                Hi, Frederic!

                --- Fredrik Lundh <fredrik@...> wrote:
                > manish wrote:
                >
                > > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
                > > <item xsi:type="xsd:string">one</item>
                > > <item xsi:type="xsd:string">two</item>
                > > <item xsi:null="1" />
                > > <item xsi:type="xsd:string">three</item>
                > > </inputStringArray>
                > > </m:echoStringArray>
                > > </SOAP-ENV:Body>
                > > </SOAP-ENV:Envelope>
                > >
                > > The item 3 in the array is null, with attribute xsi:null="1"
                >
                > but in the array declaration, you telling the receiver
                > that you're sending four strings.
                >
                > (null != empty string)
                Exactly. It should return null. As far as I understand null could be
                ANY element and null should be returned.

                .pl


                __________________________________________________
                Do You Yahoo!?
                Get email at your own domain with Yahoo! Mail.
                http://personal.mail.yahoo.com/?.refer=text
              • Mike Deem
                I agree that a complete implementation should return null. MSTK2 simple doesn t try to handle nulls in any way at this time. == Mike == ... From: Paul
                Message 7 of 16 , Apr 1 8:39 AM
                  I agree that a complete implementation should return null. MSTK2 simple
                  doesn't try to handle nulls in any way at this time.

                  == Mike ==

                  -----Original Message-----
                  From: Paul Kulchenko [mailto:paulclinger@...]
                  Sent: Sunday, April 01, 2001 8:26 AM
                  To: soapbuilders@yahoogroups.com
                  Subject: Re: [soapbuilders] MSTK2 and null


                  Hi, Frederic!

                  --- Fredrik Lundh <fredrik@...> wrote:
                  > manish wrote:
                  >
                  > > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
                  > > <item xsi:type="xsd:string">one</item>
                  > > <item xsi:type="xsd:string">two</item>
                  > > <item xsi:null="1" />
                  > > <item xsi:type="xsd:string">three</item>
                  > > </inputStringArray>
                  > > </m:echoStringArray>
                  > > </SOAP-ENV:Body>
                  > > </SOAP-ENV:Envelope>
                  > >
                  > > The item 3 in the array is null, with attribute xsi:null="1"
                  >
                  > but in the array declaration, you telling the receiver
                  > that you're sending four strings.
                  >
                  > (null != empty string)
                  Exactly. It should return null. As far as I understand null could be
                  ANY element and null should be returned.

                  .pl


                  __________________________________________________
                  Do You Yahoo!?
                  Get email at your own domain with Yahoo! Mail.
                  http://personal.mail.yahoo.com/?.refer=text


                  To unsubscribe from this group, send an email to:
                  soapbuilders-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to
                  http://docs.yahoo.com/info/terms/
                • Paul Kulchenko
                  Hi, Fredrik! ... That s the interesting question. I agree with Manish that it should be null, but question is how would default element look like? In my
                  Message 8 of 16 , Apr 1 8:52 AM
                    Hi, Fredrik!

                    --- Fredrik Lundh <fredrik@...> wrote:
                    > > I was expecting a response which indicated the item is null,
                    > rather than empty string
                    >
                    > interesting. why were you expecting that? what part of the
                    > SOAP specification made you think it would work like this?
                    >
                    > (to me, your request looks malformed. if it had been a struct
                    > instead
                    > of an array, that null element could have meant "use default". I
                    > can't
                    > find anything that supports your expectations, but I might be
                    > missing something...)
                    That's the interesting question. I agree with Manish that it should
                    be null, but question is how would 'default' element look like?

                    In my understanding,
                    <array....>
                    <item xsi:type="xsd:string">abc</item>
                    <item xsi:type="xsd:string"></item>
                    <item/>
                    <item xsi:null=1/>
                    </array>

                    First element is usual string, second is empty string, third is
                    default element (how could it be handled?) and forth is NULL element.

                    That's my understanding. Default element could be emtpy string and
                    could be something else (even null), but it's application dependent.

                    Best wishes, Paul.

                    __________________________________________________
                    Do You Yahoo!?
                    Get email at your own domain with Yahoo! Mail.
                    http://personal.mail.yahoo.com/?.refer=text
                  • Fredrik Lundh
                    ... well, all I can find in the spec is this: A NULL value or a default value MAY be represented by omission of the accessor element. A NULL value MAY also be
                    Message 9 of 16 , Apr 1 8:58 AM
                      paul wrote:

                      > > but in the array declaration, you telling the receiver
                      > > that you're sending four strings.
                      > >
                      > > (null != empty string)
                      >
                      > Exactly. It should return null. As far as I understand null could be
                      > ANY element and null should be returned.

                      well, all I can find in the spec is this:

                      A NULL value or a default value MAY be represented by omission
                      of the accessor element. A NULL value MAY also be indicated by
                      an accessor element containing the attribute xsi:null with value
                      '1' or possibly other application-dependent attributes and values.

                      which means that it's perfectly okay to replace a null value with
                      a default value (e.g. an empty string) on the way in.

                      Cheers /F
                    • Paul Kulchenko
                      Hi, Fredrik! ... Actually I read it differently. A NULL value -OR- a default value MAY be represented by omission of the accessor element. which means for me
                      Message 10 of 16 , Apr 1 9:37 AM
                        Hi, Fredrik!

                        > A NULL value or a default value MAY be represented by omission
                        > of the accessor element. A NULL value MAY also be indicated by
                        > an accessor element containing the attribute xsi:null with
                        > value
                        > '1' or possibly other application-dependent attributes and
                        > values.
                        >
                        > which means that it's perfectly okay to replace a null value with
                        > a default value (e.g. an empty string) on the way in.
                        Actually I read it differently.

                        "A NULL value -OR- a default value MAY be represented by omission of
                        the accessor element."

                        which means for me that if there is no accessor element YOU may
                        handle it as NULL -OR- DEFAULT value.

                        Second part is about NULL values ONLY: "A NULL value MAY -ALSO- be
                        indicated by an accessor element containing the attribute xsi:null
                        with value '1' or possibly other application-dependent attributes and
                        values."

                        Which means, if you want to send NULL value, you may mark them
                        explicitely. And this is ONLY null values, no relations to default
                        values in this aspect and that's perfectly correct in my
                        understanding.

                        Another question is how I can OMIT element from array, but that's
                        another story. I emulated it with <item/> which may be treated as
                        default or null element in my opinion.

                        Best wishes, Paul.

                        --- Fredrik Lundh <fredrik@...> wrote:
                        > paul wrote:
                        >
                        > > > but in the array declaration, you telling the receiver
                        > > > that you're sending four strings.
                        > > >
                        > > > (null != empty string)
                        > >
                        > > Exactly. It should return null. As far as I understand null could
                        > be
                        > > ANY element and null should be returned.
                        >
                        > well, all I can find in the spec is this:
                        >
                        > A NULL value or a default value MAY be represented by omission
                        > of the accessor element. A NULL value MAY also be indicated by
                        > an accessor element containing the attribute xsi:null with
                        > value
                        > '1' or possibly other application-dependent attributes and
                        > values.
                        >
                        > which means that it's perfectly okay to replace a null value with
                        > a default value (e.g. an empty string) on the way in.
                        >
                        > Cheers /F
                        >
                        >
                        > ------------------------ Yahoo! Groups Sponsor
                        >
                        > To unsubscribe from this group, send an email to:
                        > soapbuilders-unsubscribe@yahoogroups.com
                        >
                        >
                        >
                        > Your use of Yahoo! Groups is subject to
                        > http://docs.yahoo.com/info/terms/
                        >
                        >


                        __________________________________________________
                        Do You Yahoo!?
                        Get email at your own domain with Yahoo! Mail.
                        http://personal.mail.yahoo.com/?.refer=text
                      • Fredrik Lundh
                        ... you re right; I missed that the second part wasn t also about default values. but I still don t see why a SOAP implementation must be prepared to store a
                        Message 11 of 16 , Apr 1 10:09 AM
                          paul wrote:

                          > Actually I read it differently.
                          >
                          > "A NULL value -OR- a default value MAY be represented by omission of
                          > the accessor element."
                          >
                          > which means for me that if there is no accessor element YOU may
                          > handle it as NULL -OR- DEFAULT value.
                          >
                          > Second part is about NULL values ONLY: "A NULL value MAY -ALSO- be
                          > indicated by an accessor element containing the attribute xsi:null
                          > with value '1' or possibly other application-dependent attributes and
                          > values."
                          >
                          > Which means, if you want to send NULL value, you may mark them
                          > explicitely. And this is ONLY null values, no relations to default
                          > values in this aspect and that's perfectly correct in my
                          > understanding.

                          you're right; I missed that the second part wasn't also about default
                          values.

                          but I still don't see why a SOAP implementation must be prepared to
                          store a null value in a homogenous array.

                          "Arrays can contain instances of any subtype of the specified
                          arrayType. That is, the members may be of any type that is
                          substitutable for the type specified in the arrayType attribute,
                          according to whatever substitutability rules are expressed in
                          the schema"

                          is xsi:null really a valid subtype to any possible arrayType?

                          Cheers /F
                        • Glen Daniels
                          Hi Fredrik! ... xsi:null isn t a type at all, it s simply an indication that a value has no content. So, for instance, you can have:
                          Message 12 of 16 , Apr 1 10:09 AM
                            Hi Fredrik!

                            > is xsi:null really a valid subtype to any possible arrayType?

                            xsi:null isn't a type at all, it's simply an indication that a value has no
                            content. So, for instance, you can have:

                            <item xsi:type="xsd:string" xsi:null="1"/>

                            ...which would translate to a null string, rather than an empty string
                            (although in some environments that might be the same thing).

                            --Glen
                          • mbalsara@yahoo.com
                            ... I am using xsi:null = 1 to indicate missing element. I am using the generic NULL rule, to mean it applies to any value. Is that a correct interpretation?
                            Message 13 of 16 , Apr 1 10:43 AM
                              >
                              > Another question is how I can OMIT element from array, but that's
                              > another story. I emulated it with <item/> which may be treated as
                              > default or null element in my opinion.

                              I am using xsi:null = "1" to indicate missing element. I am using the
                              generic NULL rule, to mean it applies to any value. Is that a correct
                              interpretation?

                              Another way to represent missing element would be by using sparse
                              arrays.

                              <SOAP:ENC:Array SOAP-ENC:arrayType="xsd:string[4]">
                              <item SOAP-ENC:position=[1]">one</item>
                              <item SOAP-ENC:position=[3]">three</item>
                              </SOAP-ENC:Array>

                              manish
                            • graham glass
                              this is a tricky one. in a java language mapping, if you declare a method like foo( String[] strings ), then a null value is legal for those strings. to
                              Message 14 of 16 , Apr 1 12:27 PM
                                this is a tricky one.

                                in a java language mapping, if you declare a
                                method like foo( String[] strings ), then
                                a null value is legal for those strings.
                                to disallow null as a valid entry makes the
                                natural language mapping start to break.
                                i'd be interested to hear from soapbuilders
                                working on other language mappings whether
                                null should be an allowable value for a string.

                                cheers,
                                graham

                                -----Original Message-----
                                From: Fredrik Lundh [mailto:fredrik@...]
                                Sent: Sunday, April 01, 2001 4:52 AM
                                To: soapbuilders@yahoogroups.com
                                Subject: Re: [soapbuilders] MSTK2 and null


                                manish wrote:

                                > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
                                > <item xsi:type="xsd:string">one</item>
                                > <item xsi:type="xsd:string">two</item>
                                > <item xsi:null="1" />
                                > <item xsi:type="xsd:string">three</item>
                                > </inputStringArray>
                                > </m:echoStringArray>
                                > </SOAP-ENV:Body>
                                > </SOAP-ENV:Envelope>
                                >
                                > The item 3 in the array is null, with attribute xsi:null="1"

                                but in the array declaration, you telling the receiver
                                that you're sending four strings.

                                (null != empty string)

                                Cheers /F



                                To unsubscribe from this group, send an email to:
                                soapbuilders-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                              • yahoo@strongbrains.com
                                Indeed, null != empty string. However, the declaration SOAP-ENC:arrayType= xsd:string[4] does not preclude that some elements of the array might be null
                                Message 15 of 16 , Apr 1 9:09 PM
                                  Indeed, null != empty string.

                                  However, the declaration SOAP-ENC:arrayType="xsd:string[4]" does not
                                  preclude that some elements of the array might be null
                                  (whatever "null" means). The declaration merely says that whatever
                                  element are present will be of type xsd:string or subtypes of
                                  xsd:string and that there will not be more than four of them (in one
                                  dimension).

                                  --- In soapbuilders@y..., "Fredrik Lundh" <fredrik@p...> wrote:
                                  > manish wrote:
                                  >
                                  > > <inputStringArray SOAP-ENC:arrayType="xsd:string[4]">
                                  > > <item xsi:type="xsd:string">one</item>
                                  > > <item xsi:type="xsd:string">two</item>
                                  > > <item xsi:null="1" />
                                  > > <item xsi:type="xsd:string">three</item>
                                  > > </inputStringArray>
                                  > > </m:echoStringArray>
                                  > > </SOAP-ENV:Body>
                                  > > </SOAP-ENV:Envelope>
                                  > >
                                  > > The item 3 in the array is null, with attribute xsi:null="1"
                                  >
                                  > but in the array declaration, you telling the receiver
                                  > that you're sending four strings.
                                  >
                                  > (null != empty string)
                                  >
                                  > Cheers /F
                                • Fredrik Lundh
                                  ... sure, but can SOAP really require ALL implementations to have a string subtype that s null ? what if the arrayType is xsd:int , and I want to store the
                                  Message 16 of 16 , Apr 2 12:14 AM
                                    "yahoo@..." (who's this?) wrote:

                                    > Indeed, null != empty string.
                                    >
                                    > However, the declaration SOAP-ENC:arrayType="xsd:string[4]" does not
                                    > preclude that some elements of the array might be null
                                    > (whatever "null" means). The declaration merely says that whatever
                                    > element are present will be of type xsd:string or subtypes of
                                    > xsd:string and that there will not be more than four of them (in one
                                    > dimension).

                                    sure, but can SOAP really require ALL implementations to
                                    have a string subtype that's "null" ?

                                    what if the arrayType is "xsd:int", and I want to store the in-
                                    coming data in a C float array? (am I supposed to use NAN?
                                    that's not very portable...).

                                    or what if it's an "xsd:boolean"? do I need tristate logic?

                                    Cheers /F
                                  Your message has been successfully submitted and would be delivered to recipients shortly.