プロトタイプ・メソッドでは、出力配列を作成する必要があります。この配列は、適切に作成し管理する必要があります。
入力パラメーターとしての配列型の例から続いて登場する次の例では、Web サービスの simpleArray メソッドを呼び出し、戻される配列を使用するクライアント・アプリケーションを示しています。この例では、WSDL の nillable の単純型の配列の例で生成されるメソッドの一般的な使用法を示しています。応答の integer 配列は直接にはアクセスできません。 組み込み integer 配列を取得するには、以下のように、ユーザーが piSimpleResponseArray オブジェクトで get メソッドを呼び出す必要があります。
xsd__int_Array * piSimpleResponseArray = ws.simpleArray( &iInputArray); int iSize = 0; // Size of the array. // Pointer to a pointer that will contain the array. Get the contents // of the response. The return value will be a pointer to a pointer containing // the array and iSize will contain the number of elements in the array. // Note that it is a const pointer so cannot be manipulated. const xsd__int ** ppiIntArray = piSimpleResponseArray->get( (int&) iSize); // Check if the array size greater than zero before processing it! if( iSize > 0) { // For each element of the array... for( int iCount = 0 ; iCount < iSize ; iCount++) { // Check that that element is not null before use... if( ppiIntArray[iCount] != NULL) { cout <<“Element[” << iCount << “]=“ << *ppiIntArray[iCount] <<endl; } } } // Later in the code... delete piSimpleResponseArray; piSimpleResponseArray = NULL;