프로토타입 메소드에서는 출력 배열을 작성해야 합니다. 이 배열은 제대로 작성 및 관리되어야 합니다.
입력 매개변수로 유형 배열의 예와 같이 다음 예제는 웹 서비스에서 simpleArray 메소드를 호출하고 리턴된 배열을 사용하는 클라이언트 응용프로그램을 보여 줍니다. 다음 예제는 nillable 단순 유형 배열의 WSDL 예에서 소개된 메소드의 일반적인 사용을 보여 줍니다. 응답 정수 배열에는 직접 액세스할 수 없습니다. 임베디드 정수 배열을 가져오려면 사용자는 다음과 같이 piSimpleResponseArray 오브젝트에서 가져오기 메소드를 호출해야 합니다.
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;