Web Services Client for C++ provides array objects for each of the 45 defined simple types. These are defined in include\Axis\AxisUserAPIArrays.hpp. An example of a simple array type is xsd__int_Array.
The following example shows an extract from a WSDL that has two elements called simpleArrayRequest and simpleArrayResponse of array type integer. These elements are used by the simpleArray operation, which uses the simpleArrayRequest element to define the type of request and simpleArrayResponse element to define the type of response expected when the simpleArray operation is called.
<xsd:element name="simpleArrayRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="simpleTypeRes" type="xsd:int" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="simpleArrayResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="simpleTypeReq" type="xsd:int" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element>
Note that the maxOccurs attribute is used in this example. Web Services Client for C++ creates an array object for any type that is declared as having maxOccurs greater than one. Later in the WSDL, the simpleArrayRequest and simpleArrayResponse become the input and output parameters for the simpleArray method whose prototype is shown below:
public: xsd__int_Array * simpleArray( xsd__int_Array * pValue);
The prototype requires input and output arrays to be created. To avoid memory leaks, these must be created and managed properly. For information about the generation management and deletion of a typical input and output array, see the following two sections: