include\Axis\AxisUserAPI.hpp에 정의된 45개의 내장 단순 유형이 있습니다. 유형이 nillable 또는 선택적일 경우(즉, minOccurs=“0”) 단순 유형에 대한 포인터로 정의됩니다.
다음 예제는 WSDL의 일반 단순 유형을 보여 줍니다. 이 예제에 사용된 단순 유형은 C++ 유형 xsd__int에 맵핑되는 xsd:int입니다. WSDL의 추출에는 addReturn 유형 정수라는 요소가 있습니다. 이 요소는 추가 조작 호출 시 예상되는 응답 유형을 정의하는 데 addResponse 요소를 사용하는 추가 조작에 사용됩니다.
<element name="addResponse"> <complexType> <sequence> <element name="addReturn" type="xsd:int"/> </sequence> </complexType> </element>
WSDL에서 뒷부분에서 addResponse 요소는 추가 메소드의 응답 부분입니다. 이것은 WSDL의 단순 유형에서 다음 C++용 웹 서비스 클라이언트 웹 서비스 메소드 프로토타입을 생성합니다.
public: STORAGE_CLASS_INFO xsd__int add( …);
따라서 이 예제에서 사용자 생성 응용프로그램 코드는 다음과 같습니다.
xsd__int xsd_iReturn = ws.add( …);
유형이 참일 경우(nillable=“true”), 선택적(minOccurs=“0”) 또는 텍스트 유형(xsel:string)은 포인터로 정의됩니다.
<element name="addResponse"> <complexType> <sequence> <element name="addReturn" nillable=”true” type="xsd:int"/> </sequence> </complexType> </element>
이것은 다음 C++용 웹 서비스 클라이언트 웹 서비스 메소드 프로토타입을 생성합니다.
public: STORAGE_CLASS_INFO xsd__int * add( …);
WSDL에서 nillable 단순 유형에서 생성되는 사용자 생성 응용프로그램 코드는 다음과 같습니다.
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;