There are 45 built-in simple types, which are defined in include\Axis\AxisUserAPI.hpp. When a type is nillable or optional (that is, minOccurs=”0”), it is defined as a pointer to a simple type.
The example below shows a typical simple type in a WSDL. The simple type used in this example is xsd:int, which is mapped to C++ type xsd__int. The extract from the WSDL has an element called addReturn of type integer. This element is used by the add operation, which uses the addResponse element to define the type of response expected when the add operation is called.
<element name="addResponse"> <complexType> <sequence> <element name="addReturn" type="xsd:int"/> </sequence> </complexType> </element>
Later in the WSDL, the addResponse element is the response part for the add method. This produces the following Web Services Client for C++ web services method prototype from the simple type in the WSDL:
public: STORAGE_CLASS_INFO xsd__int add( …);
Thus, the user generated application code for this example is as follows:
xsd__int xsd_iReturn = ws.add( …);
When a type is nillable, (that is, nillable=”true”), optional (that is, minOccurs=”0"), or a text type (such as xsel:string), it is defined as a pointer.
<element name="addResponse"> <complexType> <sequence> <element name="addReturn" nillable=”true” type="xsd:int"/> </sequence> </complexType> </element>
This produces the following Web Services Client for C++ web services method prototype:
public: STORAGE_CLASS_INFO xsd__int * add( …);
The user generated application code produced by the nillable simple type in the WSDL is as follows:
xsd__int * xsd_piReturn = ws.add( …); // Later in the code… // Delete this pointer and set it to NULL (as it is owned by the client application). delete xsd_piReturn; xsd_piReturn = NULL;