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

Re: [soapbuilders] itemType value for SOAP 1.2 array of array

Expand Messages
  • Jacek Kopecky
    Robert, others, see below. 8-) Jacek Kopecky Senior Architect, Systinet Corporation http://www.systinet.com/ ... If we use XML Schema to describe the
    Message 1 of 7 , Sep 2 1:39 AM
      Robert, others, see below. 8-)

      Jacek Kopecky

      Senior Architect, Systinet Corporation
      http://www.systinet.com/



      On Sun, 1 Sep 2002, Robert van Engelen wrote:

      > > Oh, I have to add (just in case it's not clear) that a
      > > two-dimensional array is a different beast from an array of
      > > arrays. Java doesn't have multidimensional arrays, C/C++ does.
      >
      > Point taken. I presume that Java's arrays of arrays will substitute
      > multi-dimensional arrays. One issue remains unclear: what is the
      > binding time for the dimensionality of arrays? That is, can WSDL provide
      > a contractual agreement on the dimensionality or is this resolved at
      > encoding time? In comparison, programming languages usually fix
      > the dimensionality statically (cf. schemas), while the array size
      > for each dimension can be set at run time. This is an important issue
      > to implement a safe array decoding algorithm in languages that
      > support multi-dimensional arrays.

      If we use XML Schema to describe the instances, we can constrain
      the dimensionality, as I think I suggested in my original email
      on this topic, by creating a restriction of the soap-enc:Array
      type, in which the arraySize attribute only has a given number of
      components.

      Currently the attribute is an unbounded list of numbers (the
      first position can be an asterisk), so it can be "*", "3 4" and
      even "* 2 3 4 5 6 7 8" for an eight-dimensional array. So to
      specify a contract where two-dimensional arrays can be passed in
      some place, one would restrict the attribute to only two-member
      lists, like "2 3" or "* 7" and such. I won't attempt to write the
      XML Schema syntax for such a restriction because I'm sure I'd
      screw up.

      Of course it's further possible to specify that e.g. only 3x5
      arrays can be passed in one contract, by specifying a fixed value
      for the arraySize attribute.

      Best regards,

      Jacek
    • noah_mendelsohn@us.ibm.com
      ... Sure is. Most obviously, a two dimensional array must be rectangular. An array of array allows for differing extents, and perhaps differing types, for
      Message 2 of 7 , Sep 3 8:51 AM
        Jacek Kopecky writes:

        >> Oh, I have to add (just in case it's not clear)
        >> that a two-dimensional array is a different
        >> beast from an array of arrays.

        Sure is. Most obviously, a two dimensional array must be rectangular. An
        array of array allows for differing extents, and perhaps differing types,
        for the constituent sub-arrays. Jacek has clarified the declaration of
        two-dimensional arrays in SOAP encoding.

        Am I right that an array of arrays might be represented by, among other
        means, the following:


        <outer enc:itemType="xsd:anyType" enc:itemSize="2">
        <inner enc:itemType="xsd:integer" enc:itemSize="1">
        <item>15</item>
        </inner>
        <inner enc:itemType="xsd:float" enc:itemSize="3">
        <item>15.3E-5</item>
        <item>25.2</item>
        <item>37.3256</item>
        </inner>
        </outer>

        If so, then the case where both inner arrays are of the same type
        (xsd:int) must be viewed as a special case of the example above. The case
        where both are of the same type and extent is a yet more restricted
        special case, and is the one that most resembles a basic two dimensional
        array.

        BTW: in the specific case of the C language, the supported
        multi-dimensional array is specifically defined as an array of arrays, but
        with the restriction that type types are compatible and the bounds
        rectangular (regular, in the case of higher than 2D.) Page 195 of K&R
        [1] gives the example:

        static int x3d[3][5][7]

        and says about it:

        "...declares a static three dimensional array of integers, with rank
        3x5x7. In complete detail, x3d is an array of three items; each item is
        an array of five arrays; each of the latter arrays is an array of seven
        integers." So, both views at once in the case of the C language, but the
        fundamental model is arrays of arrays.

        [1] Kernighan, B.W., Ritchie, D.M., "The C Programming Language", (c) 1978
        Bell Telephone Laboratories, ISBN 0-13-110163-3

        ------------------------------------------------------------------
        Noah Mendelsohn Voice: 1-617-693-4036
        IBM Corporation Fax: 1-617-693-8676
        One Rogers Street
        Cambridge, MA 02142
        ------------------------------------------------------------------
      Your message has been successfully submitted and would be delivered to recipients shortly.