You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2005/06/21 18:28:58 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/client/cpp nillableComplexTypeClient.cpp

prestonf    2005/06/21 09:28:58

  Added:       c/tests/auto_build/testcases/client/cpp
                        nillableComplexTypeClient.cpp
  Log:
  Added an additional unit test: nillableComplexType
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/nillableComplexTypeClient.cpp
  
  Index: nillableComplexTypeClient.cpp
  ===================================================================
  #include "nillableComplexType.hpp"
  #include <iostream>
  
  int main(int argc, char* argv[])
  {
  	try
  	{
  		char *  pszEndpoint = "http://whaler.hursley.ibm.com:9090/CalculatorDoc/services/CalculatorDoc";
  
  		if( argc > 0)
  		{
  			pszEndpoint = argv[1];
  		}
  
  		nillableComplexType * pwsnillableComplexType = new nillableComplexType( pszEndpoint);
  	
  		xsd__string			sValue = "Hello";
  		xsd__base64Binary * pb64Value = new xsd__base64Binary();
  		xsd__NMTOKEN		nmValue = 0;
  		char *				psz64BitValue = "FRED";
  
  	    pb64Value->__ptr = (unsigned char *) psz64BitValue;
  	    pb64Value->__size = strlen (psz64BitValue);
  
  		xsd__string  sResult = pwsnillableComplexType->Report( sValue, pb64Value, nmValue);
  
  		cout << "The result is " << sResult << endl;
  
  		delete pwsnillableComplexType;
  	}
  	catch( SoapFaultException& sfe)
  	{
  		// Catch any other SOAP faults
  		cout << "SoapFaultException: " << sfe.getFaultCode() << " " << sfe.what() << endl;
  	}
  	catch( AxisException& e)
  	{
  		// Catch an AXIS exception
  	cout << "AxisException: " << e.getExceptionCode() << " " << e.what() << endl;
  	}
  	catch( exception& e)
  	{
  		// Catch a general exception
  	cout << "Unknown Exception: " << e.what() << endl;
  	}
  	catch( ...)
  	{
  		// Catch any other exception
  	cout << "Unspecified Exception: " << endl;
  	}
  
      cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
  
      // Exit.
      return 0;
  }