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

RE: [soapbuilders] Re: Sparse array interoperability

Expand Messages
  • Paul Kulchenko
    Hi, Matt! ... I would rather see number 3 as invalid case (apples and oranges) and I still think that sparse array is not exactly the same as usual array with
    Message 1 of 60 , Sep 3, 2001
    • 0 Attachment
      Hi, Matt!

      > I would tend to believe that the representation of these 3 arrays
      > are equivalent...
      I would rather see number 3 as invalid case (apples and oranges) and
      I still think that sparse array is not exactly the same as usual
      array with omitted elements.

      Why do you need to mix them? If you have an array
      [nil, nil, 2, 3, nil, nil] you can express it as

      <myArray SOAP-ENC:arrayType="xsd:string[6]" SOAP-ENC:offset="[2]">
      <item>one</item>
      <item>two</item>
      </myArray>

      Sparse arrays are different. They are "arrays" because they are
      indexed by numbers, but (for me) they are not interoperable with
      usual arrays, aren't they?

      It's very similar to difference between multidimensional arrays and
      arrays of arrays. Will you accept array of arrays as echo for
      multidimensional array?

      Best wishes, Paul.

      --- Matt Long <mlong@...> wrote:
      > I would tend to believe that the representation of these 3 arrays
      > are equivalent...
      >
      > thoughts?
      >
      >
      > <myArray SOAP-ENC:arrayType="xsd:string[3]" SOAP-ENC:offset="[1]">
      > <item>one</item>
      > <item>two</item>
      > </myArray>
      >
      > <myArray SOAP-ENC:arrayType="xsd:string[3]">
      > <item SOAP-ENC:position="[1]">one</item>
      > <item SOAP-ENC:position="[2]">two</item>
      > </myArray>
      >
      > <myArray SOAP-ENC:arrayType="xsd:string[3]" SOAP-ENC:offset="[1]">
      > <item>one</item>
      > <item SOAP-ENC:position="[2]">two</item>
      > </myArray>
      >
      > > -----Original Message-----
      > > From: Matt Long [mailto:mlong@...]
      > > Sent: Monday, September 03, 2001 10:09 AM
      > > To: soapbuilders@yahoogroups.com
      > > Subject: RE: [soapbuilders] Re: Sparse array interoperability
      > >
      > >
      > > Hi Bob,
      > >
      > > I believe it is possible to incorporate offset + position
      > > (meaning if you
      > > don't you will have a must fault condition when this occurs
      > > albeit that the
      > > array is NOT malformed). So to answer your question, it does
      > > make sense (to
      > > at least me) when you review the possibility that the array
      > > is NOT malformed
      > > when containing both offset + position.
      > >
      > > -Matt
      > >
      > >
      > >
      > >
      > >
      > > > -----Original Message-----
      > > > From: Bob Cunnings [mailto:cunnings@...]
      > > > Sent: Monday, September 03, 2001 10:02 AM
      > > > To: soapbuilders@yahoogroups.com
      > > > Subject: Re: [soapbuilders] Re: Sparse array interoperability
      > > >
      > > >
      > > > Hello,
      > > >
      > > > Does Nbr. 8 make any sense?
      > > >
      > > > RC
      > > >
      > > > > Is this accurate?
      > > > >
      > > > > Therefore, an "echoArray" interop test for Sec 5 encoding
      > > > should be able
      > > > to
      > > > > echo:
      > > > >
      > > > > 1) members as simple types
      > > > > 2) members as complex types
      > > > > 3) members as arrays (simple types, complex types,
      > > arrays, or null)
      > > > > 4) members as null
      > > > > 5) null array or members as null arrays
      > > > > 6) array w/ offset
      > > > > 7) array w/ position (sparse array) Note:use of "position"
      > > > is a hint that
      > > > > the array MAY be sparse.
      > > > > 8) array w/ offset + position (sparse array w/ offset)
      > > > >
      > > > >
      > > > > -Matt
      > > > >
      > > > >
      > > > >
      > > > > > -----Original Message-----
      > > > > > From: Andrew Layman [mailto:mail@...]
      > > > > > Sent: Sunday, September 02, 2001 11:45 PM
      > > > > > To: soapbuilders@yahoogroups.com
      > > > > > Subject: Re: [soapbuilders] Re: Sparse array
      > interoperability
      > > > > >
      > > > > >
      > > > > > Fair question. If one of the uses of a sparse array is to
      > > > > > pass incremental
      > > > > > updates, then the array being filled in at the receiving
      > end
      > > > > > would reflect
      > > > > > the sum of all the increments received so far.
      > > > > >
      > > > > > One alternative for echoSparseArray would be to echo the
      > > > exact array
      > > > > > immediately received (NAKAMURA, Hiroshi option 5). The
      > other
      > > > > > would be to
      > > > > > say that the response should echo back, not the sparse
      > array
      > > > > > immediately
      > > > > > received, but the array resulting from the sum of all prior
      > > > > > increments.
      > > > > >
      > > > > > Of these, the latter makes assumptions about application
      > > > > > rules that the
      > > > > > former does not, so I'd recommend the simple echo of the
      > > > sparse array
      > > > > > immediately received.
      > > > > >
      > > > > > Andrew Layman
      > > > > > http://strongbrains.com -- Resources for Self-Education
      > > > > > ----- Original Message -----
      > > > > > From: "Paul Kulchenko" <paulclinger@...>
      > > > > > To: <soapbuilders@yahoogroups.com>
      > > > > > Sent: Sunday, September 02, 2001 9:23 PM
      > > > > > Subject: Re: [soapbuilders] Re: Sparse array
      > interoperability
      > > > > >
      > > > > >
      > > > > > Hi, Andrew!
      > > > > >
      > > > > > I think question how sparse arrays look like and what
      > > they are is
      > > > > > answered. Question for me is what sender expects to get
      > from
      > > > > > echoArray sending sparse array? Does he expects exactly the
      > same
      > > > > > sparse array back? If it's just an array with some gaps
      > > (whatever
      > > > > > they are) can I fill them and return it as an usual array?
      > > > > >
      > > > > > Best wishes, Paul.
      > > > > >
      > > > > > --- Andrew Layman <mail@...> wrote:
      > > > > > > I think we had a pretty good case made here that sparse
      > > > arrays have
      > > > > > > the
      > > > > > > semantics described in DCE: transmission of parts, not
      > > > all, of an
      > > > > > > array. If
      > > > > > > this is difficult to implement in some SOAP support
      > > libraries, I
      > > > > > > recommend
      > > > > > > that it would be better to omit sparse arrays from
      > > this round of
      > > > > > > testing
      > > > > > > rather than invent a novel interpretation of what a
      > > sparse array
      > > > > > > is.
      > > > > > >
      > > > > > > Andrew Layman
      > > > > > > http://strongbrains.com -- Resources for Self-Education
      > > > > > > ----- Original Message -----
      > > > > > > From: "NAKAMURA, Hiroshi" <nahi@...>
      > > > > > > To: <soapbuilders@yahoogroups.com>
      > > > > > > Sent: Sunday, September 02, 2001 8:37 PM
      > > > > > > Subject: [soapbuilders] Re: Sparse array interoperability
      > > > > > >
      > > > > > >
      > > > > > > Hi,
      > > > > > >
      > > > > > > > From: Rich Salz [mailto:rsalz@...]
      > > > > > > > Sent: Saturday, September 01, 2001 9:41 AM
      > > > > > >
      > > > > > > > > Let me try to rephrase this. What you are saying
      > > is that the
      > > > > > > sparse
      > > > > > > > > array is the result of a "masking" operation of sorts
      > on a
      > > > > > > source
      > > > > > > > > array?.
      > > > > > > >
      > > > > > > > Sort of.
      > > > > > > >
      > > > > > > > Think of it more like each side allocates the whole
      > > array, but
      > > > > > > only part
      > > > > > > > of it is transmitted at any one time.
      > > > > > > >
      > > > > > > > Using the "hello world" of web serivces: stock quotes.
      > > > > > > >
      > > > > > > > Client connects to server and sends up a list of 200
      > > > stocks it's
      > > > > > > > interested in. It sends up an array of
      > > > > > > <ticker,last-known-price>.
      > > > > > > >
      > > > > > > > Later on, client sends "gimme the big gainers"
      > > > request. Server
      > > > > > > sends
      > > > > > > > down a sparse array of <ticker,last-known-price>.
      > > The client
      > > > > > > > application can just unpack that array directly on
      > > top of the
      > > > > > > client's
      >
      === message truncated ===


      __________________________________________________
      Do You Yahoo!?
      Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
      http://im.yahoo.com
    • NAKAMURA, Hiroshi
      Hi Paul, ... In SOAP4R; Using low level API, user application gets an instance of SOAPArray class in either case of usual array/sparse array. Using high level
      Message 60 of 60 , Sep 4, 2001
      • 0 Attachment
        Hi Paul,

        > From: Paul Kulchenko [mailto:paulclinger@...]
        > Sent: Tuesday, September 04, 2001 9:13 AM

        > > I do not think so. If sparse array is not interoperable
        > > with usual array, it does not have to be an array.

        > If this is correct then question is "how"? How usual array should
        > look like in this case? In my current implementation, sparse array is
        > the same as array with undef/null elements, but I'm not sure it's
        > correct.

        In SOAP4R;

        Using low level API, user application gets an instance of
        SOAPArray class in either case of usual array/sparse array.
        Using high level API, user application gets an instance of
        common Array class in Ruby in either case. Sparse array is
        the same as usual array with nil elements in high level API.
        User application which wants to use sparse array must use
        low level API.

        So I must build echo interop server using low level API
        when the interop echo R2 application adopts Option 5.

        > > We sometimes want the array including indeterminate elements
        > > (such as VARIANT ARRAY with many Empty in COM, array with
        > > many undef-s in Perl). We can reduce transmitted data
        > > using Sparse array to pass these type of array. I believe
        > > SOAP authors introduce Sparse array for this purpose.

        > how implementation should look like in this case? Would you scan
        > EVERY array to check how many nulls are there? Would you allow user
        > (who doesn't care about it) tell that he want to have "sparse" array
        > on wire? It does make sense ONLY if there is already some type in a
        > language that implements sparse arrays. But I do not expect SOAP
        > processor to be so smart and choose between array and sparse array
        > checking number of empty elements.

        In SOAP4R, SOAP node knows whether it is an usual array or
        sparse array. When receiving an array, with "offset" or
        "position" attribute, SOAP4R recognize it as a sparse array.
        When sending an array, user application must define it as
        a sparse array by low level API.

        I mean, SOAP4R consider a partial array with "offset" as a
        sparse array. It could be an error under lexical context
        of SOAP spec, but I think these 2 special arrays is for the
        same purpose.

        > > > It's very similar to difference between multidimensional arrays
        > > and
        > > > arrays of arrays. Will you accept array of arrays as echo for
        > > > multidimensional array?
        > > I disagree here. Common array and Sparse array have same
        > > type of content (arrayType). 1D-Array and 2D-Array have
        > > different arrayType.
        > That's true. My point was different. They look different on wire, but
        > they are the same in some languages (Perl for example). So, you're
        > saying that they are indeed different and you do NOT accept one as
        > echo for another one. That's similar to my point about sparse arrays.
        > Ther MAY look the same as usual array in your language, but they are
        > different. Looks like I'm the only one who support this point of view
        > ;).
        >
        > Let me summarize. This discussion was started from echoArray problem
        > when you send sparse array and I send back usual array where omitted
        > elements are nulls. How correct is it? Definitely what I'm sending
        > back IS NOT a sparse array. So what? Is it proper echo? Andrew's
        > point was that sparse array and array with nulls ARE NOT the same. In
        > theory (sorry, Andrew ;)). How about practice? If I CANNOT echo usual

        In SOAP data model level, we know we cannot define how we
        should do, don't we? In the R2 echo application level, we
        are discussing how we should do for testing inteoperability
        in a most effective way, I think.

        Someone like Option 5, someone like Option 1. I can accept
        Option 5. Which do you like?

        Options:
        http://groups.yahoo.com/group/soapbuilders/message/5128

        Regards,
        // NaHi

        PS. I'm sorry if I'm blunt because of my poor English...
      Your message has been successfully submitted and would be delivered to recipients shortly.