axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: ws-axis/c/tests/auto_build/testcases/wsdls FourLevelTestDoc.wsdl
Date Tue, 01 Feb 2005 13:14:38 GMT
dicka       2005/02/01 05:14:38

  Added:       c/tests/auto_build/testcases/client/cpp
                        FourLevelTestDocClient.cpp
               c/tests/auto_build/testcases/output
                        FourLevelTestDoc.expected
               c/tests/auto_build/testcases/server/cpp
                        FourLevelTestDocInterface.cpp
               c/tests/auto_build/testcases/tests FourLevelTestDoc.xml
               c/tests/auto_build/testcases/wsdls FourLevelTestDoc.wsdl
  Log:
  Adding additional test provided by Carsten Blecken.
  
  Submitted by: Carsten Blecken
  Reviewed by: Adrian Dick
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/FourLevelTestDocClient.cpp
  
  Index: FourLevelTestDocClient.cpp
  ===================================================================
  // FourLevelTestDocClient.cpp : Defines the entry point for the console application.i
  //
  #include <string>
  using namespace std;
  
  #include "fourLevelTestDocInterface.hpp"
  #include <axis/AxisException.hpp>
  
  int main(int argc, char* argv[])
  {
  	int x;
  	char buffer1[100];
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/fourLevelTestDoc";
  	const char* server="localhost";
  	const char* port="80";
  	url = argv[1];
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		FourLevelTestDocInterface ws(endpoint);
  
  		FourthLevelElemType* fourth = new FourthLevelElemType();
  		fourth->SampleString = strdup("abc");
  		fourth->SampleInt = 1;
  
  		FourthLevelElemType_Array* fourth_array = new FourthLevelElemType_Array();
  		fourth_array->m_Array = fourth;
  		fourth_array->m_Size = 1;
  
  		ThirdLevelElemType* third = new ThirdLevelElemType();
  		third->FourthLevelElem = *fourth_array;
  
  		ThirdLevelElemType_Array* third_array = new ThirdLevelElemType_Array();
  		third_array->m_Array = third;
  		third_array->m_Size = 1;
  
  		SecondLevelElemType* second = new SecondLevelElemType();
  		second->ThirdLevelElem = *third_array;
  
  		SecondLevelElemType_Array* second_array = new SecondLevelElemType_Array();
  		second_array->m_Array = second;
  		second_array->m_Size = 1;
  
  
  //		SecondLevelElemType_Array in_array = new SecondLevelElemType_Array();
  //		in_array.m_Array = second_arr;
  //		in_array.m_Size = 1;
  		
  		SecondLevelElemType_Array out_array;
  
  		out_array = ws.RetrieveTestDoc(*second_array);
  
  		printf("Size = %d\n", out_array.m_Size);
  		printf("String = %s\n", out_array.m_Array->ThirdLevelElem.m_Array->FourthLevelElem.m_Array->SampleString);
  
  			
  	}
  	catch(AxisException& e)
  	{
  	    printf("Exception : %s\n", e.what());
  	}
  	catch(exception& e)
  	{
  	    printf("Unknown exception has occured\n");
  	}
  	catch(...)
  	{
  	    printf("Unknown exception has occured\n");
  	}
  	return 0;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/FourLevelTestDoc.expected
  
  Index: FourLevelTestDoc.expected
  ===================================================================
  Size = 1
  String = def
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/server/cpp/FourLevelTestDocInterface.cpp
  
  Index: FourLevelTestDocInterface.cpp
  ===================================================================
  /*
   * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
   * This file contains definitions of the web service
   */
  
  #include "FourLevelTestDocInterface.hpp"
  
  
  FourLevelTestDocInterface::FourLevelTestDocInterface()
  {
  }
  
  FourLevelTestDocInterface::~FourLevelTestDocInterface()
  {
  }
  
  /* This function is called by the AxisEngine when something went wrong
   with the current web service request processing. Appropriate actions should
   be taken here.*/
  void FourLevelTestDocInterface::onFault()
  {
  }
  /* This function is called by the AxisEngine when this web service
   library is first loaded. So here we can initialize any global/static
   data structures of this web service or open database connections */
  void FourLevelTestDocInterface::init()
  {
  }
  /* This function is called by the AxisEngine when this web service
   library is unloaded. So we can deallocate any global/static data structures
   and close database connections etc here. */
  void FourLevelTestDocInterface::fini()
  {
  }
  SecondLevelElemType_Array FourLevelTestDocInterface::RetrieveTestDoc(SecondLevelElemType_Array
Value0)  
  {
  	//if (NULL == Value0) 
  	//	return 0;
  
  	char* type = Value0.m_Array[0].ThirdLevelElem.m_Array[0].FourthLevelElem.m_Array[0].SampleString;
  	if (type != NULL) {
  		if (strcmp(type, "abc")) {
  			throw new AxisServiceException(33);
  		}
  	}
  
  	FourthLevelElemType* fourth = new FourthLevelElemType();
  	fourth->SampleString = strdup("def");
  	fourth->SampleInt = 1;
  
  	FourthLevelElemType_Array* fourth_array = new FourthLevelElemType_Array();
  	fourth_array->m_Array = fourth;
  	fourth_array->m_Size = 1;
  
  	ThirdLevelElemType* third = new ThirdLevelElemType();
  	third->FourthLevelElem = *fourth_array;
  
  	ThirdLevelElemType_Array* third_array = new ThirdLevelElemType_Array();
  	third_array->m_Array = third;
  	third_array->m_Size = 1;
  
  	SecondLevelElemType* second = new SecondLevelElemType();
  	second->ThirdLevelElem = *third_array;
  
  	SecondLevelElemType_Array* second_array = new SecondLevelElemType_Array();
  	second_array->m_Array = second;
  	second_array->m_Size = 1;
  
  	return *second_array;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/tests/FourLevelTestDoc.xml
  
  Index: FourLevelTestDoc.xml
  ===================================================================
  <test>
      <name>FourLevelTestDoc</name>
      <description>Tests four levels of tag nesting for doc style</description>
      <clientLang>cpp</clientLang>
      <clientCode>FourLevelTestDocClient.cpp</clientCode>
      <wsdl>FourLevelTestDoc.wsdl</wsdl>
      <expected>
          <output>
              FourLevelTestDoc.expected
          </output>
      </expected>
      <endpoint>http://localhost:80/axis/FourLevelTestDocService</endpoint>
  </test>
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/wsdls/FourLevelTestDoc.wsdl
  
  Index: FourLevelTestDoc.wsdl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <definitions name="LicenseUsageHistoryService" targetNamespace="urn:org.apache:ws-axis/c/test/v1_0"
xmlns:impl="urn:org.apache:ws-axis/c/test/v1_0" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
  	<types>
  		<schema targetNamespace="urn:org.apache:ws-axis/c/test/v1_0" xmlns:impl="urn:org.apache:ws-axis/c/test/v1_0"
 xmlns="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified">
  			<complexType name="FourthLevelElemType">
  				<sequence>
  					<element name="SampleString" type="xsd:string"/>
  					<element name="SampleInt" type="xsd:int"/>
  				</sequence>
  			</complexType>
  			<complexType name="ThirdLevelElemType">
  				<sequence>
  					<element name="FourthLevelElem" type="impl:FourthLevelElemType" maxOccurs="unbounded"/>
  				</sequence>
  			</complexType>
  			<complexType name="SecondLevelElemType">
  				<sequence>
  					<element name="ThirdLevelElem" type="impl:ThirdLevelElemType" maxOccurs="unbounded"/>
  				</sequence>
  			</complexType>
  			<complexType name="FirstLevelElemType">
  				<sequence>
  					<element name="SecondLevelElem" type="impl:SecondLevelElemType" maxOccurs="unbounded"/>
  				</sequence>
  			</complexType>
  			<element name="FirstLevelElem" type="impl:FirstLevelElemType"/>
  		</schema>
  	</types>
  	<message name="TestDocRequest">
  		<part element="impl:FirstLevelElem" name="inputPart"/>
  	</message>
  	<message name="TestDocResponse">
  		<part element="impl:FirstLevelElem" name="outputPart"/>
  	</message>
  	<portType name="FourLevelTestDocInterface">
  		<operation name="RetrieveTestDoc">
  			<input message="impl:TestDocRequest" name="TestDocRequest"/>
  			<output message="impl:TestDocResponse" name="TestDocResponse"/>
  		</operation>
  	</portType>
  	<binding name="FourLevelTestDocBinding" type="impl:FourLevelTestDocInterface">
  		<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  		<operation name="RetrieveTestDoc">
  			<soap:operation soapAction="FourLevelTestDocService#RetrieveTestDoc" style="document"/>
  			<input name="TestDocRequest">
  				<soap:body namespace="urn:org.apache:ws-axis/c/test/v1_0" use="literal"/>
  			</input>
  			<output name="TestDocResponse">
  				<soap:body namespace="urn:org.apache:ws-axis/c/test/v1_0" use="literal"/>
  			</output>
  		</operation>
  	</binding>
  	<service name="FourLevelTestDocService">
  		<port binding="impl:FourLevelTestDocBinding" name="FourLevelTestDoc">
  			<soap:address location="http://localhost:80/axis/FourLevelTestDoc"/>
  		</port>
  	</service>
  </definitions>
  
  
  

Mime
View raw message