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

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

Expand Messages
  • Robert van Engelen
    Jacek, Thanks for the explanation. ... I agree. It certainly should not. The schemas will tell the difference. ... I can t argue that. ... Point taken. I
    Message 1 of 7 , Sep 1, 2002
    • 0 Attachment
      Jacek,

      Thanks for the explanation.

      > Then you can give this type a name, anything like
      > "2dArrayOfFoo", "ArrayOfFoo", "Bar" or other. The name should not
      > play any role in distinguishing arrays from other types.

      I agree. It certainly should not. The schemas will tell the difference.

      > It is my opinion that using XML Schema to describe data in the
      > SOAP Data Model is flawed (XML Schema's data model being
      > different; one cannot easily combine data models), but apparently
      > enough "common understanding of hacks" exists for this to be
      > viable.

      I can't argue that.

      > 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.

      Regards, Robert van Engelen

      > Best regards,
      >
      > Jacek Kopecky
      >
      > Senior Architect, Systinet Corporation
      > http://www.systinet.com/
      >
      >
      >
      > On Wed, 28 Aug 2002, Robert van Engelen wrote:
      >
      > >
      > > Hi,
      > >
      > > What is the itemType attribute information item value for a SOAP 1.2 array of
      > > arrays? I can't find a definition of this anywhere in the specs and there are
      > > no examples to go on.
      > >
      > > Suppose we have an array of array of xsd:int. Is the following representation
      > > correct?
      > >
      > > <aOfa SOAP-ENC:itemType="xsd:int[]" SOAP-ENC:arraySize="2">
      > > <item SOAP-ENC:itemType="xsd:int" SOAP-ENC:arraySize="0"></item>
      > > <item SOAP-ENC:itemType="xsd:int" SOAP-ENC:arraySize="1"><item>1</item></item>
      > > </aOfa>
      > >
      > > That is, can we use the SOAP 1.1 array types such as "xsd:int[]"? If not, what
      > > is the type? Is it an application-defined XML schema type such as "s:array"?
      > >
      > > - Robert van Engelen
    • 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 2 of 7 , Sep 2, 2002
      • 0 Attachment
        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 3 of 7 , Sep 3, 2002
        • 0 Attachment
          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.