Arrays: Arrays are the most common type of vectors. They contain multiple values are each element
of the array is indexed by a number (also called the "key"), 0 - (
N-1) where
N is the number of elements in the array. In some languages, arrays can contain mixed data types, that
is to say that we could have an array with the values
{12, "Hello world!", 3412.11}
and they can even contain arrays of arrays (called multidimensional arrays).
Associative Arrays ("hashes"): Very similar to a normal array, except the 0 - (
N-1) keys in
the array are now replaced with strings. This is the most common form of returning multiple values from a SOAP call, e.g.
Common_Module::get_disk_quota
returns a hash with keys
"used"
and
"total"
.
Objects: Just as strings are a catch-all for scalars, objects are a catch-all for vectors, although objects
tend to be a bit more complex in certain circumstances. Objects are generally avoided in apnscp esprit and are only seen when created via a
complexType
in SOAP.
At this time there are no instances of
complexType
and shouldn't be in the future.
Mixed: These are the true catch-all; mixed means that it can be anything. It can be a scalar or a vector. It could be a boolean or an object. Returned values &151; what a SOAP call sends back to your application
are never mixed, but parameters &151; things you pass off to a SOAP function, can be. This is done to simplify a function within the control panel, for instance we might
have a function called
File_Module::delete_files
. It wouldn't be prudent to make 100 SOAP calls to remove 100 files in a directory. It would be more efficient
to just make one call to
File_Module::delete_files
with an array of strings that represent the files to delete.