axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/tests/client/threadSafe/gen_src InteropTestPortType.cpp InteropTestPortType.h SOAPStruct.cpp SOAPStruct.h SOAPStruct_Array.h
Date Wed, 09 Jun 2004 10:57:34 GMT
samisa      2004/06/09 03:57:34

  Added:       c/tests/client/threadSafe Client.cpp
               c/tests/client/threadSafe/gen_src InteropTestPortType.cpp
                        InteropTestPortType.h SOAPStruct.cpp SOAPStruct.h
                        SOAPStruct_Array.h
  Log:
  test case for thread safety
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/client/threadSafe/Client.cpp
  
  Index: Client.cpp
  ===================================================================
  // InteropBaseClient.cpp : Defines the entry point for the console application.
  //
  #include <string>
  #include <pthread.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <unistd.h>
  
  using namespace std;
  
  #include "gen_src/InteropTestPortType.h"
  
  #define ARRAYSIZE 2
  #define NUM_THREADS     3
  
  
  const char *server = "localhost";
  const char *port = "8080";
  char endpoint[256];
  
  void *
  run(void *arg)
  {
      int x;
      char buffer1[100];
      
      //sprintf(endpoint, "http://%s:%s/axis/base", server, port);
      //endpoint for Axis Java sample
      sprintf(endpoint, "http://%s:%s/axis/services/echo", server, port);
  
  
      InteropTestPortType *ws;
  
      if (arg == NULL)
  	ws = new InteropTestPortType(endpoint);
      else
  	ws = (InteropTestPortType *) arg;
  
  
      printf("invoking echoString...\n");
      //testing echoString 
      string bigstring;
      for (int ii = 0; ii < 2; ii++)
      {
  	bigstring += "hello world ";
      }
      strcpy(buffer1, bigstring.c_str());
      printf(ws->echoString(buffer1));
      if (0 == strcmp(ws->echoString("hello world"), "hello world"))
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echoStringArray 
      xsd__string_Array arrstr;
      arrstr.m_Array = new char *[ARRAYSIZE];
      arrstr.m_Size = ARRAYSIZE;
      sprintf(buffer1, "%dth element of string array", 0);
      //sprintf(buffer2, "%dth element of string array", 1);
      for (int i = 0; i < ARRAYSIZE; i++)
      {
  	arrstr.m_Array[i] = buffer1;
      }
      //arrstr.m_Array[1] = buffer2;
      printf("invoking echoStringArray...\n");
      if (ws->echoStringArray(arrstr).m_Array != NULL)
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echoInteger 
      printf("invoking echoInteger...\n");
      if (ws->echoInteger(56) == 56)
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echoIntegerArray 
      xsd__int_Array arrint;
      arrint.m_Array = new int[ARRAYSIZE];
      arrint.m_Size = ARRAYSIZE;
      for (x = 0; x < ARRAYSIZE; x++)
      {
  	arrint.m_Array[x] = x;
      }
      printf("invoking echoIntegerArray...\n");
      if (ws->echoIntegerArray(arrint).m_Array != NULL)
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echoFloat 
      printf("invoking echoFloat...\n");
      float fvalue = 1.4214;
      if (ws->echoFloat(fvalue) > 1.42)
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echoFloat 
      xsd__float_Array arrfloat;
      arrfloat.m_Array = new float[ARRAYSIZE];
      arrfloat.m_Size = ARRAYSIZE;
      for (x = 0; x < ARRAYSIZE; x++)
      {
  	arrfloat.m_Array[x] = 1.1111 * x;
      }
      printf("invoking echoFloatArray...\n");
      if (ws->echoFloatArray(arrfloat).m_Array != NULL)
  	printf("successful\n");
      else
  	printf("failed\n");
      // testing echo Struct
      SOAPStruct stct;
      stct.varFloat = 12345.7346345;
      stct.varInt = 5000;
      stct.varString = strdup("This is string in SOAPStruct");
      printf("invoking echoStruct...\n");
      if (ws->echoStruct(&stct) != NULL)
  	printf("successful\n");
      else
  	printf("failed\n");
      //testing echo Array of Struct
      SOAPStruct_Array arrstct;
      arrstct.m_Array = new SOAPStruct[ARRAYSIZE];
      arrstct.m_Size = ARRAYSIZE;
      for (x = 0; x < ARRAYSIZE; x++)
      {
  	arrstct.m_Array[x].varFloat = 1.1111 * x;
  	arrstct.m_Array[x].varInt = x;
  	sprintf(buffer1, "varString of %dth element of SOAPStruct array", x);
  	arrstct.m_Array[x].varString = buffer1;
      }
      //testing echo Struct Array
      printf("invoking echoStructArray...\n");
      if (ws->echoStructArray(arrstct).m_Array != NULL)
  	printf("successful\n");
      else
  	printf("failed\n");
      //testing echo void
      printf("invoking echoVoid...\n");
      ws->echoVoid();
      printf("successful\n");
      //testing echo base 64 binary
  
      const char *bstr =
  	"some string that is sent encoded to either base64Binary or hexBinary";
  
      printf("invoking echoBase64...\n");
      xsd__base64Binary bb;
      bb.__ptr = (unsigned char *) strdup(bstr);
      bb.__size = strlen(bstr);
      if (bb.__size == ws->echoBase64(bb).__size)
      {
  	printf("successful\n");
  	printf("Returned String :\n%s\n", bb.__ptr);
      }
      else
  	printf("failed\n");
  
      time_t tim;
      time(&tim);
      tm *lt = gmtime(&tim);
      printf("invoking echoDate...\n");
      if (memcmp(&ws->echoDate(*lt), lt, sizeof(tm)) == 0)
  	printf("successful\n");
      else
  	printf("failed\n");
      //testing echo hex binary
  
      printf("invoking echoHexBinary...\n");
      xsd__hexBinary hb;
      hb.__ptr = (unsigned char *) strdup(bstr);
      hb.__size = strlen(bstr);
      if (hb.__size == ws->echoHexBinary(hb).__size)
      {
  	printf("successful\n");
  	printf("Returned String :\n%s\n", hb.__ptr);
      }
      else
  	printf("failed\n");
      //testing echo decimal
      printf("invoking echoDecimal...\n");
      if (ws->echoDecimal(1234.567890) > 1234.56)
  	printf("successful\n");
      else
  	printf("failed\n");
      //testing echo boolean
      printf("invoking echoBoolean...\n");
      if (ws->echoBoolean(true_) == true_)
  	printf("successful\n");
      else
  	printf("failed\n");
  
      return 0;
  }
  
  int
  main(int argc, char *argv[])
  {
      if (argc > 2)
      {
  	server = argv[1];
  	port = argv[2];
      }
  
      if (argc > 3)
      {
  	printf("Usage :\n %s <server> <port>\n\n", argv[0]);
  	printf("Sending Requests to Server http://%s:%s ........\n\n", server,
  	       port);
  
  	//sprintf(endpoint, "http://%s:%s/axis/base", server, port);
  	//endpoint for Axis Java sample
  	sprintf(endpoint, "http://%s:%s/axis/services/echo", server, port);
  	InteropTestPortType *ws = new InteropTestPortType(endpoint);
      }
  
      pthread_t thread[NUM_THREADS];
      pthread_attr_t attr;
      int rc, t, status;
  
      /* Initialize and set thread detached attribute */
      pthread_attr_init(&attr);
      pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
  
      for (t = 0; t < NUM_THREADS; t++)
      {
  	printf("Creating thread %d\n", t);
  	rc = pthread_create(&thread[t], &attr, run, NULL);
  	if (rc)
  	{
  	    printf("ERROR; return code from pthread_create() is %d\n", rc);
  	    exit(-1);
  	}
      }
  
      /* Free attribute and wait for the other threads */
      pthread_attr_destroy(&attr);
      for (t = 0; t < NUM_THREADS; t++)
      {
  	//rc = pthread_join(thread[t], (void **)&status);
  	rc = pthread_detach(thread[t]);
  	if (rc)
  	{
  	    printf("ERROR return code from pthread_join() is %d\n", rc);
  	    exit(-1);
  	}
  	printf("Completed join with thread %d status= %d\n", t, status);
      }
  
      pthread_exit(NULL);
  }
  
  
  
  1.1                  ws-axis/c/tests/client/threadSafe/gen_src/InteropTestPortType.cpp
  
  Index: InteropTestPortType.cpp
  ===================================================================
  /*
   * This is the Client Stub implementation file genarated by WSDL2Ws tool.
   * InteropTestPortType.cpp: implemtation for the InteropTestPortType.
  * Default when no parameter passed. When thrown with no parameter 
  more general InteropTestPortType  is assumed.
   *
   */
  
  #include "InteropTestPortType.h"
  
  #include <axis/server/AxisWrapperAPI.h>
  
  using namespace std;
  
   bool CallBase::bInitialized;
  CallFunctions CallBase::ms_VFtable;
  extern int Axis_DeSerialize_SOAPStruct(SOAPStruct* param, IWrapperSoapDeSerializer *pDZ);
  extern void* Axis_Create_SOAPStruct(SOAPStruct *Obj, bool bArray = false, int nSize=0);
  extern void Axis_Delete_SOAPStruct(SOAPStruct* param, bool bArray = false, int nSize=0);
  extern int Axis_Serialize_SOAPStruct(SOAPStruct* param, IWrapperSoapSerializer* pSZ, bool
bArray = false);
  extern int Axis_GetSize_SOAPStruct();
  
  InteropTestPortType::InteropTestPortType(const char* pchEndpointUri)
  :Stub(pchEndpointUri)
  {
  }
  
  InteropTestPortType::~InteropTestPortType()
  {
  }
  
  
  /*Methods corresponding to the web service methods*/
  
  /*
   * This method wrap the service method echoString
   */
  xsd__string InteropTestPortType::echoString(xsd__string Value0)
  {
  	xsd__string Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoString");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoString", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputString", XSD_STRING);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoStringResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsString("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoStringArray
   */
  xsd__string_Array InteropTestPortType::echoStringArray(xsd__string_Array Value0)
  {
  	xsd__string_Array RetArray = {NULL, 0};
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return RetArray;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoStringArray");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoStringArray", "http://soapinterop.org/");
  		applyUserPreferences();
  	m_pCall->addBasicArrayParameter((Axis_Array*)(&Value0), XSD_STRING, "inputStringArray");
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoStringArrayResponse", "http://soapinterop.org/"))
  			{
  				RetArray = (xsd__string_Array&)m_pCall->getBasicArray(XSD_STRING, "return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return RetArray;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoInteger
   */
  int InteropTestPortType::echoInteger(int Value0)
  {
  	int Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoInteger");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoInteger", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputInteger", XSD_INT);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoIntegerResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsInt("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoIntegerArray
   */
  xsd__int_Array InteropTestPortType::echoIntegerArray(xsd__int_Array Value0)
  {
  	xsd__int_Array RetArray = {NULL, 0};
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return RetArray;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoIntegerArray");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoIntegerArray", "http://soapinterop.org/");
  		applyUserPreferences();
  	m_pCall->addBasicArrayParameter((Axis_Array*)(&Value0), XSD_INT, "inputIntegerArray");
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoIntegerArrayResponse", "http://soapinterop.org/"))
  			{
  				RetArray = (xsd__int_Array&)m_pCall->getBasicArray(XSD_INT, "return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return RetArray;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoFloat
   */
  float InteropTestPortType::echoFloat(float Value0)
  {
  	float Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoFloat");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoFloat", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputFloat", XSD_FLOAT);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoFloatResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsFloat("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoFloatArray
   */
  xsd__float_Array InteropTestPortType::echoFloatArray(xsd__float_Array Value0)
  {
  	xsd__float_Array RetArray = {NULL, 0};
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return RetArray;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoFloatArray");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoFloatArray", "http://soapinterop.org/");
  		applyUserPreferences();
  	m_pCall->addBasicArrayParameter((Axis_Array*)(&Value0), XSD_FLOAT, "inputFloatArray");
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoFloatArrayResponse", "http://soapinterop.org/"))
  			{
  				RetArray = (xsd__float_Array&)m_pCall->getBasicArray(XSD_FLOAT, "return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return RetArray;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoStruct
   */
  SOAPStruct* InteropTestPortType::echoStruct(SOAPStruct* Value0)
  {
  	SOAPStruct* pReturn = NULL;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return pReturn;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoStruct");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoStruct", "http://soapinterop.org/");
  		applyUserPreferences();
  	m_pCall->addCmplxParameter(Value0, (void*)Axis_Serialize_SOAPStruct, (void*)Axis_Delete_SOAPStruct,
"inputStruct", Axis_URI_SOAPStruct);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoStructResponse", "http://soapinterop.org/"))
  			{
  				pReturn = (SOAPStruct*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_SOAPStruct,
(void*) Axis_Create_SOAPStruct, (void*) Axis_Delete_SOAPStruct,"return", 0);
  		}
  		}
  		m_pCall->unInitialize();
  		return pReturn;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoStructArray
   */
  SOAPStruct_Array InteropTestPortType::echoStructArray(SOAPStruct_Array Value0)
  {
  	SOAPStruct_Array RetArray = {NULL, 0};
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return RetArray;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoStructArray");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoStructArray", "http://soapinterop.org/");
  		applyUserPreferences();
  	m_pCall->addCmplxArrayParameter((Axis_Array*)(&Value0), (void*)Axis_Serialize_SOAPStruct,
(void*)Axis_Delete_SOAPStruct, (void*) Axis_GetSize_SOAPStruct, "inputStructArray", Axis_URI_SOAPStruct);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoStructArrayResponse", "http://soapinterop.org/"))
  			{
  				RetArray = (SOAPStruct_Array&)m_pCall->getCmplxArray((void*) Axis_DeSerialize_SOAPStruct,
(void*) Axis_Create_SOAPStruct, (void*) Axis_Delete_SOAPStruct, (void*) Axis_GetSize_SOAPStruct,
"return", Axis_URI_SOAPStruct);
  			}
  		}
  		m_pCall->unInitialize();
  		return RetArray;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoVoid
   */
  void InteropTestPortType::echoVoid()
  {
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return ;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoVoid");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoVoid", "http://soapinterop.org/");
  		applyUserPreferences();
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoVoidResponse", "http://soapinterop.org/"))
  			{
  			/*not successful*/
  		}
  		}
  		m_pCall->unInitialize();
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoBase64
   */
  xsd__base64Binary InteropTestPortType::echoBase64(xsd__base64Binary Value0)
  {
  	xsd__base64Binary Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoBase64");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoBase64", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputBase64", XSD_BASE64BINARY);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoBase64Response", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsBase64Binary("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoDate
   */
  xsd__dateTime InteropTestPortType::echoDate(xsd__dateTime Value0)
  {
  	xsd__dateTime Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoDate");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoDate", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputDate", XSD_DATETIME);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoDateResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsDateTime("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoHexBinary
   */
  xsd__hexBinary InteropTestPortType::echoHexBinary(xsd__hexBinary Value0)
  {
  	xsd__hexBinary Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoHexBinary");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoHexBinary", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputHexBinary", XSD_HEXBINARY);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoHexBinaryResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsHexBinary("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoDecimal
   */
  xsd__decimal InteropTestPortType::echoDecimal(xsd__decimal Value0)
  {
  	xsd__decimal Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoDecimal");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoDecimal", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputDecimal", XSD_DECIMAL);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoDecimalResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsDecimal("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  
  /*
   * This method wrap the service method echoBoolean
   */
  xsd__boolean InteropTestPortType::echoBoolean(xsd__boolean Value0)
  {
  	xsd__boolean Ret;
  	char* cFaultcode;
  	char* cFaultstring;
  	char* cFaultactor;
  	char* cFaultdetail;
  	try
  	{
  		if (AXIS_SUCCESS != m_pCall->initialize(CPP_RPC_PROVIDER, NORMAL_CHANNEL)) 
  			return Ret;
  		m_pCall->setTransportProperty(SOAPACTION_HEADER , "InteropBase#echoBoolean");
  		m_pCall->setSOAPVersion(SOAP_VER_1_1);
  		m_pCall->setOperation("echoBoolean", "http://soapinterop.org/");
  		applyUserPreferences();
  		m_pCall->addParameter((void*)&Value0, "inputBoolean", XSD_BOOLEAN);
  		if (AXIS_SUCCESS == m_pCall->invoke())
  		{
  			if(AXIS_SUCCESS == m_pCall->checkMessage("echoBooleanResponse", "http://soapinterop.org/"))
  			{
  				Ret = m_pCall->getElementAsBoolean("return", 0);
  			}
  		}
  		m_pCall->unInitialize();
  		return Ret;
  	}
  	catch(AxisException& e)
  	{
  		if (AXIS_SUCCESS == m_pCall->checkFault("Fault","http://localhost/axis/InteropBase"
))//Exception handling code goes here
  		{
  			cFaultcode = m_pCall->getElementAsString("faultcode", 0);
  			cFaultstring = m_pCall->getElementAsString("faultstring", 0);
  			cFaultactor = m_pCall->getElementAsString("faultactor", 0);
  				  cFaultdetail = m_pCall->getElementAsString("faultdetail", 0);
  				  throw AxisException(cFaultdetail);
  		}
  		else throw;
  	}
  }
  
  int InteropTestPortType::getStatus()
  {
  	if ( m_pCall==NULL ) 
  		return AXIS_SUCCESS; 
  	else 
  		return m_pCall->getStatus();
  }
  
  int InteropTestPortType::getFaultDetail(char** ppcDetail)
  {
  	return m_pCall->getFaultDetail(ppcDetail);
  }
  
  
  
  
  1.1                  ws-axis/c/tests/client/threadSafe/gen_src/InteropTestPortType.h
  
  Index: InteropTestPortType.h
  ===================================================================
  /*
   * This is the Client Stub Class genarated by the tool WSDL2Ws
   * InteropTestPortType.h: interface for the InteropTestPortTypeclass.
   *
   */
  #if !defined(__INTEROPTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_)
  #define __INTEROPTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_
  
  #include <axis/client/Stub.h>
  /*include Exception header files here*/
  #include "SOAPStruct_Array.h"
  #include "SOAPStruct.h"
  
  class InteropTestPortType :public Stub
  {
  public:
  	InteropTestPortType(const char* pchEndpointUri);
  public:
  	virtual ~InteropTestPortType();
  public: 
  	xsd__string echoString(xsd__string Value0);
  	xsd__string_Array echoStringArray(xsd__string_Array Value0);
  	int echoInteger(int Value0);
  	xsd__int_Array echoIntegerArray(xsd__int_Array Value0);
  	float echoFloat(float Value0);
  	xsd__float_Array echoFloatArray(xsd__float_Array Value0);
  	SOAPStruct* echoStruct(SOAPStruct* Value0);
  	SOAPStruct_Array echoStructArray(SOAPStruct_Array Value0);
  	void echoVoid();
  	xsd__base64Binary echoBase64(xsd__base64Binary Value0);
  	xsd__dateTime echoDate(xsd__dateTime Value0);
  	xsd__hexBinary echoHexBinary(xsd__hexBinary Value0);
  	xsd__decimal echoDecimal(xsd__decimal Value0);
  	xsd__boolean echoBoolean(xsd__boolean Value0);
  	int getStatus();
  	int getFaultDetail(char** ppcDetail);
  };
  
  #endif /* !defined(__INTEROPTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_)*/
  
  
  
  1.1                  ws-axis/c/tests/client/threadSafe/gen_src/SOAPStruct.cpp
  
  Index: SOAPStruct.cpp
  ===================================================================
  /*
   *This file is automatically generated by the Axis C++ Wrapper Class Generator
   *Web service wrapper class's implementation generated by Axis WCG
   *Parameters and wrapper methos to manipulate SOAPStruct
   */
  
  #include <malloc.h>
  #include "SOAPStruct.h"
  #include <axis/server/AxisWrapperAPI.h>
  
  /*
   * This static method serialize a SOAPStruct type of object
   */
  int Axis_Serialize_SOAPStruct(SOAPStruct* param, IWrapperSoapSerializer* pSZ, bool bArray
= false)
  {
  	if (bArray)
  	{
  		pSZ->serialize("<", Axis_TypeName_SOAPStruct, ">", NULL);
  	}
  	else
  	{
  		const AxisChar* sPrefix = pSZ->getNamespacePrefix(Axis_URI_SOAPStruct);
  		pSZ->serialize("<", Axis_TypeName_SOAPStruct, " xsi:type=\"", sPrefix, ":",
  			Axis_TypeName_SOAPStruct, "\" xmlns:", sPrefix, "=\"",
  			Axis_URI_SOAPStruct, "\">", NULL);
  	}
  
  	pSZ->serializeAsElement("varString", (void*)&(param->varString), XSD_STRING);
  	pSZ->serializeAsElement("varInt", (void*)&(param->varInt), XSD_INT);
  	pSZ->serializeAsElement("varFloat", (void*)&(param->varFloat), XSD_FLOAT);
  
  	pSZ->serialize("</", Axis_TypeName_SOAPStruct, ">", NULL);
  	return AXIS_SUCCESS;
  }
  
  /*
   * This static method deserialize a SOAPStruct type of object
   */
  int Axis_DeSerialize_SOAPStruct(SOAPStruct* param, IWrapperSoapDeSerializer *pIWSDZ)
  {
  	param->varString = pIWSDZ->getElementAsString("varString",0);
  	param->varInt = pIWSDZ->getElementAsInt("varInt",0);
  	param->varFloat = pIWSDZ->getElementAsFloat("varFloat",0);
  	return pIWSDZ->getStatus();
  }
  void* Axis_Create_SOAPStruct(SOAPStruct* pObj, bool bArray = false, int nSize=0)
  {
  	if (bArray && (nSize > 0))
  	{
  		if (pObj)
  		{
  			SOAPStruct* pNew = new SOAPStruct[nSize];
  			memcpy(pNew, pObj, sizeof(SOAPStruct)*nSize/2);
  			memset(pObj, 0, sizeof(SOAPStruct)*nSize/2);
  			delete [] pObj;
  			return pNew;
  		}
  		else
  		{
  			return new SOAPStruct[nSize];
  		}
  	}
  	else
  		return new SOAPStruct;
  }
  
  /*
   * This static method delete a SOAPStruct type of object
   */
  void Axis_Delete_SOAPStruct(SOAPStruct* param, bool bArray = false, int nSize=0)
  {
  	if (bArray)
  	{
  		delete [] param;
  	}
  	else
  	{
  		delete param;
  	}
  }
  /*
   * This static method gives the size of SOAPStruct type of object
   */
  int Axis_GetSize_SOAPStruct()
  {
  	return sizeof(SOAPStruct);
  }
  
  SOAPStruct::SOAPStruct()
  {
  	/*do not allocate memory to any pointer members here
  	 because deserializer will allocate memory anyway. */
  }
  
  SOAPStruct::~SOAPStruct()
  {
  	/*delete any pointer and array members here*/
  }
  
  
  
  1.1                  ws-axis/c/tests/client/threadSafe/gen_src/SOAPStruct.h
  
  Index: SOAPStruct.h
  ===================================================================
  /*
   *This file is automatically generated by the Axis C++ Wrapper Class Generator
   *Web service wrapper class's implementation generated by Axis WCG
   *Parameters and wrapper methos to manipulate SOAPStruct
   */
  
  #if !defined(__SOAPSTRUCT_PARAM_H__INCLUDED_)
  #define __SOAPSTRUCT_PARAM_H__INCLUDED_
  
  #include <axis/server/AxisUserAPI.h>
  
  /*Local name and the URI for the type*/
  static const char* Axis_URI_SOAPStruct = "http://soapinterop.org/xsd";
  static const char* Axis_TypeName_SOAPStruct = "SOAPStruct";
  
  class SOAPStruct
  {
  public:
  	xsd__string varString;
  	int varInt;
  	float varFloat;
  	SOAPStruct();
  	virtual ~SOAPStruct();
  };
  
  #endif /* !defined(__SOAPSTRUCT_PARAM_H__INCLUDED_)*/
  
  
  
  1.1                  ws-axis/c/tests/client/threadSafe/gen_src/SOAPStruct_Array.h
  
  Index: SOAPStruct_Array.h
  ===================================================================
  /*
   *This file is automatically generated by the Axis C++ Wrapper Class Generator
   *Web service wrapper class's implementation generated by Axis WCG
   *Parameters and wrapper methos to manipulate SOAPStruct_Array
   */
  
  #if !defined(__SOAPSTRUCT_ARRAY_ARRAY_H__INCLUDED_)
  #define __SOAPSTRUCT_ARRAY_ARRAY_H__INCLUDED_
  
  class SOAPStruct;
  
  typedef struct SOAPStruct_ArrayTag
  {
  	SOAPStruct* m_Array;
  	int m_Size;
  } SOAPStruct_Array;
  
  #endif /* !defined(__SOAPSTRUCT_ARRAY_ARRAY_H__INCLUDED_)*/
  
  
  

Mime
View raw message