WebSphere Web Services Client for C++, Version 1.0.1 Operating Systems: Linux, Solaris

XML built-in simple types

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.

Typical example of 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( …);

Example of a pointer to a simple type

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;
Note: The example above shows the deletion of the return value. Any pointer that Web Services Client for C++ returns becomes the responsibility of the client application and does not go out of scope if the web service is deleted. The user application must delete the pointer to the object type once it is no longer required.

Reference topic

Terms of Use | Rate this page

Timestamp iconLast updated: 12 Dec 2005
(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)