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 ja...@apache.org on 2005/03/23 11:42:30 UTC
cvs commit: ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest Calculator.cpp IntArrayType.hpp SimpleTypeArrayWS.cpp IntArrayType.cpp MathOps.cpp ArrayTestPortType.hpp Combo_TTestClient.cpp DivByZeroStruct.hpp SimpleTypeArrayWS.hpp Type.hpp ArrayTestPortType.cpp MathOps.hpp Type.cpp Calculator.hpp DivByZeroStruct.cpp
jamejose 2005/03/23 02:42:30
Added: c/tests/auto_build/testcases/dynamic/Combo_TTest
Calculator.cpp IntArrayType.hpp
SimpleTypeArrayWS.cpp IntArrayType.cpp MathOps.cpp
ArrayTestPortType.hpp Combo_TTestClient.cpp
DivByZeroStruct.hpp SimpleTypeArrayWS.hpp Type.hpp
ArrayTestPortType.cpp MathOps.hpp Type.cpp
Calculator.hpp DivByZeroStruct.cpp
Log:
Multi stub thread test
Revision Changes Path
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/Calculator.cpp
Index: Calculator.cpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub implementation for remote web service.
*/
#include "Calculator.hpp"
#include <axis/AxisWrapperAPI.hpp>
Calculator::Calculator(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol):Stub(pcEndpointUri, eProtocol)
{
}
Calculator::Calculator()
:Stub(" ", APTHTTP1_1)
{
m_pCall->setEndpointURI("http://localhost/axis/Calculator");
}
Calculator::~Calculator()
{
}
/*Methods corresponding to the web service methods*/
/*
* This method wrap the service methodadd
*/
xsd__int Calculator::add(xsd__int Value0, xsd__int Value1)
{
xsd__int Ret = 0;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return Ret;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "Calculator#add");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("add", "http://localhost/axis/Calculator");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_0", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value0, cPrefixAndParamName0, XSD_INT);
char cPrefixAndParamName1[17];
sprintf( cPrefixAndParamName1, "%s:arg_1_0", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value1, cPrefixAndParamName1, XSD_INT);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("addResponse", "http://localhost/axis/Calculator"))
{
xsd__int * pReturn = m_pCall->getElementAsInt("addReturn", 0);
if(pReturn)
Ret = *pReturn;
}
}
m_pCall->unInitialize();
return Ret;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/Calculator" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*
* This method wrap the service methodsub
*/
xsd__int Calculator::sub(xsd__int Value0, xsd__int Value1)
{
xsd__int Ret = 0;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return Ret;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "Calculator#sub");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("sub", "http://localhost/axis/Calculator");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_1", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value0, cPrefixAndParamName0, XSD_INT);
char cPrefixAndParamName1[17];
sprintf( cPrefixAndParamName1, "%s:arg_1_1", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value1, cPrefixAndParamName1, XSD_INT);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("subResponse", "http://localhost/axis/Calculator"))
{
xsd__int * pReturn = m_pCall->getElementAsInt("subReturn", 0);
if(pReturn)
Ret = *pReturn;
}
}
m_pCall->unInitialize();
return Ret;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/Calculator" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*
* This method wrap the service methodmul
*/
xsd__int Calculator::mul(xsd__int Value0, xsd__int Value1)
{
xsd__int Ret = 0;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return Ret;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "Calculator#mul");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("mul", "http://localhost/axis/Calculator");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_2", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value0, cPrefixAndParamName0, XSD_INT);
char cPrefixAndParamName1[17];
sprintf( cPrefixAndParamName1, "%s:arg_1_2", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value1, cPrefixAndParamName1, XSD_INT);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("mulResponse", "http://localhost/axis/Calculator"))
{
xsd__int * pReturn = m_pCall->getElementAsInt("mulReturn", 0);
if(pReturn)
Ret = *pReturn;
}
}
m_pCall->unInitialize();
return Ret;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/Calculator" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*
* This method wrap the service methoddiv
*/
xsd__int Calculator::div(xsd__int Value0, xsd__int Value1)
{
xsd__int Ret = 0;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return Ret;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "Calculator#div");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("div", "http://localhost/axis/Calculator");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_3", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value0, cPrefixAndParamName0, XSD_INT);
char cPrefixAndParamName1[17];
sprintf( cPrefixAndParamName1, "%s:arg_1_3", m_pCall->getNamespacePrefix("http://localhost/axis/Calculator"));
m_pCall->addParameter((void*)&Value1, cPrefixAndParamName1, XSD_INT);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://localhost/axis/Calculator"))
{
xsd__int * pReturn = m_pCall->getElementAsInt("divReturn", 0);
if(pReturn)
Ret = *pReturn;
}
}
m_pCall->unInitialize();
return Ret;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/Calculator" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*Methods for supporting SecureChannel*/
void Calculator::SetSecure( char * pszArguments, ...)
{
int iArgIndex = 0;
va_list args;
char * pszArg = NULL;
va_start( args, pszArguments);
if( (pszArg = pszArguments) != NULL)
{
do
{
if( pszArg == (char *) 1)
{
sArguments[iArgIndex] = "true";
}
else
{
sArguments[iArgIndex] = pszArg;
}
iArgIndex++;
} while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
if( iArgIndex == 6)
{
sArguments[iArgIndex] = "false";
}
}
va_end( args);
}
void Calculator::includeSecure()
{
m_pCall->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments);
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.hpp
Index: IntArrayType.hpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type IntArrayType
*/
#if !defined(__INTARRAYTYPE_PARAM_H__INCLUDED_)
#define __INTARRAYTYPE_PARAM_H__INCLUDED_
#include <axis/AxisUserAPI.hpp>
AXIS_CPP_NAMESPACE_USE
/*Local name and the URI for the type*/
static const char* Axis_URI_IntArrayType = "http://soapinterop.org";
static const char* Axis_TypeName_IntArrayType = "IntArrayType";
class STORAGE_CLASS_INFO IntArrayType
{
public:
xsd__int_Array intItem;
IntArrayType();
~IntArrayType();
};
#endif /* !defined(__INTARRAYTYPE_PARAM_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/SimpleTypeArrayWS.cpp
Index: SimpleTypeArrayWS.cpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub implementation for remote web service.
*/
#include "SimpleTypeArrayWS.hpp"
#include <axis/AxisWrapperAPI.hpp>
extern int Axis_DeSerialize_Type(Type* param, IWrapperSoapDeSerializer* pDZ);
extern void* Axis_Create_Type(Type *Obj, bool bArray = false, int nSize=0);
extern void Axis_Delete_Type(Type* param, bool bArray = false, int nSize=0);
extern int Axis_Serialize_Type(Type* param, IWrapperSoapSerializer* pSZ, bool bArray = false);
extern int Axis_GetSize_Type();
SimpleTypeArrayWS::SimpleTypeArrayWS(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol):Stub(pcEndpointUri, eProtocol)
{
}
SimpleTypeArrayWS::SimpleTypeArrayWS()
:Stub(" ", APTHTTP1_1)
{
m_pCall->setEndpointURI("http://localhost:9080/SimpleTypeArray/services/sampleWS");
}
SimpleTypeArrayWS::~SimpleTypeArrayWS()
{
}
/*Methods corresponding to the web service methods*/
/*
* This method wrap the service methodgetInput
*/
Type* SimpleTypeArrayWS::getInput(Type* Value0)
{
Type* pReturn = NULL;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return pReturn;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "null");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("getInput", "http://simpletypearray.test.apache.org");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[] = "input";
m_pCall->addCmplxParameter(Value0, (void*)Axis_Serialize_Type, (void*)Axis_Delete_Type, cPrefixAndParamName0, Axis_URI_Type);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("getInputResponse", "http://simpletypearray.test.apache.org"))
{
pReturn = (Type*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_Type, (void*) Axis_Create_Type, (void*) Axis_Delete_Type,"input", 0);
}
}
m_pCall->unInitialize();
return pReturn;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost:9080/SimpleTypeArray/services/sampleWS" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*Methods for supporting SecureChannel*/
void SimpleTypeArrayWS::SetSecure( char * pszArguments, ...)
{
int iArgIndex = 0;
va_list args;
char * pszArg = NULL;
va_start( args, pszArguments);
if( (pszArg = pszArguments) != NULL)
{
do
{
if( pszArg == (char *) 1)
{
sArguments[iArgIndex] = "true";
}
else
{
sArguments[iArgIndex] = pszArg;
}
iArgIndex++;
} while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
if( iArgIndex == 6)
{
sArguments[iArgIndex] = "false";
}
}
va_end( args);
}
void SimpleTypeArrayWS::includeSecure()
{
m_pCall->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments);
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/IntArrayType.cpp
Index: IntArrayType.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type IntArrayType
*/
#include <axis/AxisWrapperAPI.hpp>
#include "IntArrayType.hpp"
/*
* This static method serialize a IntArrayType type of object
*/
int Axis_Serialize_IntArrayType(IntArrayType* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
if ( param == NULL )
{
/* TODO : may need to check nillable value - Now done*/
pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN);
pSZ->serialize( ">", NULL);
return AXIS_SUCCESS;
}
/* first serialize attributes if any*/
pSZ->serialize( ">", 0);
/* then serialize elements if any*/
pSZ->serializeBasicArray((Axis_Array*)(¶m->intItem), Axis_URI_IntArrayType,XSD_INT, "intItem");
return AXIS_SUCCESS;
}
/*
* This static method deserialize a IntArrayType type of object
*/
int Axis_DeSerialize_IntArrayType(IntArrayType* param, IWrapperSoapDeSerializer* pIWSDZ)
{
Axis_Array array;
array = pIWSDZ->getBasicArray(XSD_INT, "intItem",0);
param->intItem.m_Array = (xsd__int**)new xsd__int*[array.m_Size];
param->intItem.m_Size = array.m_Size;
memcpy( param->intItem.m_Array, array.m_Array, sizeof( xsd__int) * array.m_Size);
return pIWSDZ->getStatus();
}
void* Axis_Create_IntArrayType(IntArrayType* pObj, bool bArray = false, int nSize=0)
{
if (bArray && (nSize > 0))
{
if (pObj)
{
IntArrayType* pNew = new IntArrayType[nSize];
memcpy(pNew, pObj, sizeof(IntArrayType)*nSize/2);
memset(pObj, 0, sizeof(IntArrayType)*nSize/2);
delete [] pObj;
return pNew;
}
else
{
return new IntArrayType[nSize];
}
}
else
return new IntArrayType;
}
/*
* This static method delete a IntArrayType type of object
*/
void Axis_Delete_IntArrayType(IntArrayType* param, bool bArray = false, int nSize=0)
{
if (bArray)
{
delete [] param;
}
else
{
delete param;
}
}
/*
* This static method gives the size of IntArrayType type of object
*/
int Axis_GetSize_IntArrayType()
{
return sizeof(IntArrayType);
}
IntArrayType::IntArrayType()
{
/*do not allocate memory to any pointer members here
because deserializer will allocate memory anyway. */
intItem.m_Array = 0;
intItem.m_Size = 0;
}
IntArrayType::~IntArrayType()
{
/*delete any pointer and array members here*/
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/MathOps.cpp
Index: MathOps.cpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub implementation for remote web service.
*/
#include "MathOps.hpp"
#include <axis/AxisWrapperAPI.hpp>
extern int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer* pDZ);
extern void* Axis_Create_DivByZeroStruct(DivByZeroStruct *Obj, bool bArray = false, int nSize=0);
extern void Axis_Delete_DivByZeroStruct(DivByZeroStruct* param, bool bArray = false, int nSize=0);
extern int Axis_Serialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapSerializer* pSZ, bool bArray = false);
extern int Axis_GetSize_DivByZeroStruct();
MathOps::MathOps(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol):Stub(pcEndpointUri, eProtocol)
{
}
MathOps::MathOps()
:Stub(" ", APTHTTP1_1)
{
m_pCall->setEndpointURI("http://localhost/axis/MathOps");
}
MathOps::~MathOps()
{
}
/*Methods corresponding to the web service methods*/
/*
* This method wrap the service methoddiv
*/
xsd__int MathOps::div(xsd__int Value0, xsd__int Value1)
{
xsd__int Ret = 0;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return Ret;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("div", "http://soapinterop.org");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_0", m_pCall->getNamespacePrefix("http://soapinterop.org"));
m_pCall->addParameter((void*)&Value0, cPrefixAndParamName0, XSD_INT);
char cPrefixAndParamName1[17];
sprintf( cPrefixAndParamName1, "%s:arg_1_0", m_pCall->getNamespacePrefix("http://soapinterop.org"));
m_pCall->addParameter((void*)&Value1, cPrefixAndParamName1, XSD_INT);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("divResponse", "http://soapinterop.org"))
{
xsd__int * pReturn = m_pCall->getElementAsInt("divReturn", 0);
if(pReturn)
Ret = *pReturn;
}
}
m_pCall->unInitialize();
return Ret;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/MathOps" );
if(pSoapFault)
{
pcCmplxFaultName = pSoapFault->getCmplxFaultObjectName();
if(0 == strcmp("DivByZeroStruct", pcCmplxFaultName))
{
DivByZeroStruct* pFaultDetail =
(DivByZeroStruct*)pSoapFault->getCmplxFaultObject(
(void*) Axis_DeSerialize_DivByZeroStruct,
(void*) Axis_Create_DivByZeroStruct,
(void*) Axis_Delete_DivByZeroStruct,
"DivByZeroStruct",
0);
pFaultDetail->setFaultCode(pSoapFault->getFaultcode());
pFaultDetail->setFaultString(pSoapFault->getFaultstring());
pFaultDetail->setFaultActor(pSoapFault->getFaultactor());
pFaultDetail->setExceptionCode(e.getExceptionCode());
m_pCall->unInitialize();
throw *pFaultDetail;
}
else
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*Methods for supporting SecureChannel*/
void MathOps::SetSecure( char * pszArguments, ...)
{
int iArgIndex = 0;
va_list args;
char * pszArg = NULL;
va_start( args, pszArguments);
if( (pszArg = pszArguments) != NULL)
{
do
{
if( pszArg == (char *) 1)
{
sArguments[iArgIndex] = "true";
}
else
{
sArguments[iArgIndex] = pszArg;
}
iArgIndex++;
} while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
if( iArgIndex == 6)
{
sArguments[iArgIndex] = "false";
}
}
va_end( args);
}
void MathOps::includeSecure()
{
m_pCall->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments);
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/ArrayTestPortType.hpp
Index: ArrayTestPortType.hpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub Class for remote web service
*/
#if !defined(__ARRAYTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_)
#define __ARRAYTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_
#include <axis/client/Stub.hpp>
#include <axis/OtherFaultException.hpp>
#include <axis/ISoapFault.hpp>
AXIS_CPP_NAMESPACE_USE
#include "IntArrayType.hpp"
class ArrayTestPortType :public Stub
{
public:
STORAGE_CLASS_INFO ArrayTestPortType(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);
STORAGE_CLASS_INFO ArrayTestPortType();
public:
STORAGE_CLASS_INFO virtual ~ArrayTestPortType();
public:
STORAGE_CLASS_INFO void SetSecure( char *, ...);
STORAGE_CLASS_INFO IntArrayType* echoIntArray(IntArrayType* Value0);
private:
void includeSecure();
protected:
std::string sArguments[8];
};
#endif /* !defined(__ARRAYTESTPORTTYPE_CLIENTSTUB_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/Combo_TTestClient.cpp
Index: Combo_TTestClient.cpp
===================================================================
/* This program will create 10 Threads and each thread will invoke different Service
@Author James
*/
#include "SimpleTypeArrayWS.hpp"
#include "MathOps.hpp"
#include "Calculator.hpp"
#include "ArrayTestPortType.hpp"
#include <axis/AxisException.hpp>
//#include <exception>
#include <ctype.h>
#include <iostream>
#include <stdlib.h>
#include <axis/Axis.hpp>
#include <string.h>
/* Defining platform specific constants */
#ifdef WIN32
#include <windows.h>
#define RETTYPE DWORD WINAPI
#define ARGTYPE LPVOID
#else
#include <pthread.h>
#include <unistd.h>
#define RETTYPE void*
#define ARGTYPE void*
#endif
//#define MACRO_NUM_THREADS 10
//int NUM_THREADS = MACRO_NUM_THREADS;
#define NUM_THREADS 10
#define ARRAYSIZE 2
/* In windows the entry point function return type is DWORD WINAPI
In linux it is void * */
RETTYPE calThreadFunc(ARGTYPE Param)
{
/*Type casting the url to char * */
char *p=(char *)Param;
char endpoint[256];
const char* url="http://localhost:9060/Calculator/services/Calculator";
if(p!=NULL)
url=p;
int iResult;
try
{
sprintf(endpoint, "%s", url);
Calculator ws(endpoint);
iResult = ws.add(3,2);
if(iResult==5)
cout << "successful ";
}
catch(AxisException& e)
{
cout << "Exception : " << e.what() << endl;
}
catch(exception& e)
{
cout << "Unknown exception has occured" << endl;
}
catch(...)
{
cout << "Unknown exception has occured" << endl;
}
#ifndef WIN32
pthread_exit(0);
#endif
return 0;
}
RETTYPE arrayDocThreadFunc(ARGTYPE Param)
{
/*Type casting the url to char * */
char *p=(char *)Param;
char endpoint[256];
int x;
const char* url="http://localhost:9060/SimpleArray/services/arrayTest";
if(p!=NULL)
url=p;
try
{
sprintf(endpoint, "%s", url);
ArrayTestPortType ws(endpoint);
//testing echoIntArray
IntArrayType arrin;
arrin.intItem.m_Array = new int*[ARRAYSIZE];
int * intArray = new int[ARRAYSIZE];
arrin.intItem.m_Size = ARRAYSIZE;
for (x=0;x<ARRAYSIZE;x++)
{
intArray[x] = x;
arrin.intItem.m_Array[x] = &intArray[x];
}
if (ws.echoIntArray(&arrin)->intItem.m_Array != NULL)
cout << "successful ";
else
cout << "failed "<<endl;
}catch(AxisException& e)
{
cout << "Exception : " << e.what() << endl;
}
catch(exception& e)
{
cout << "Unknown exception has occured" << endl;
}
catch(...)
{
cout << "Unknown exception has occured" << endl;
}
#ifndef WIN32
pthread_exit(0);
#endif
return 0;
}
RETTYPE mathOpsThreadFunc(ARGTYPE Param)
{
/*Type casting the url to char * */
char *p=(char *)Param;
char endpoint[256];
const char* url="http://localhost:9060/MathOps/services/MathOps";
if(p!=NULL)
url=p;
const char* op = 0;
const char* p1 = 0;
const char* p2 = 0;
int i1=0, i2=0;
int iResult;
try
{
sprintf(endpoint, "%s", url);
MathOps ws(endpoint);
op = "div";/*Operation name*/
i1 = 10;/*First parameter*/
i2 = 5;/*Second parameter*/
if (strcmp(op, "div") == 0)
{
iResult = ws.div(i1, i2);
if(iResult==2)
cout << "successful ";
}
else
{
cout << "Invalid operation "<< op<< endl<<endl;
}
}catch(AxisException& e)
{
cout << "Exception : " << e.what() << endl;
}
catch(exception& e)
{
cout << "Unknown exception has occured" << endl;
}
catch(...)
{
cout << "Unknown exception has occured" << endl;
}
#ifndef WIN32
pthread_exit(0);
#endif
return 0;
}
RETTYPE simpleTypeThreadFunc(ARGTYPE Param)
{
/*Type casting the url to char * */
char *p=(char *)Param;
char endpoint[256];
const char* url="http://localhost:9060/SimpleTypeArray/services/sampleWS";
if(p!=NULL)
url=p;
SimpleTypeArrayWS *ws;
try
{
sprintf(endpoint, "%s", url);
ws=new SimpleTypeArrayWS(endpoint, APTHTTP1_1);
Type *input;
Type *output;
xsd__int_Array array_input;
int entries[100];
int i;
array_input.m_Array = new int*[100];
array_input.m_Size = 100;
for ( i = 0; i < 100; i++ ) {
entries[i] = i;
array_input.m_Array[i] = &entries[i];
}
input = new Type();
input->item = array_input;
output = ws->getInput(input);
i=0;
if(*(output->item.m_Array[i])== 0)
cout << "successful ";
delete ws;
}
catch(AxisException& e)
{
cout << "Exception : " << e.what() << endl;
}
catch(exception& e)
{
cout << "Unknown exception has occured" << endl;
}
catch(...)
{
cout << "Unknown exception has occured" << endl;
}
#ifndef WIN32
pthread_exit(0);
#endif
return 0;
}
int main(int argc, char *argv[])
{
Axis::initialize(false);
try{
int i;
char *endpoint_list[4];
int count=0;
/* Extracting endpoints for 4 stubs.*/
if(argc>=7){
for(i=0;i<4;i++){
char *temp=argv[3+i];
count=0;
endpoint_list[i]=new char[100];
for(int j=0;temp[j]!='\0';j++){
if(temp[j]=='/')
count++;
if(count==3){
sprintf(endpoint_list[i],"%s%s:%s%s","http://",argv[1],argv[2],&temp[j]);
break;
}
}
}
}else{
cout<<"Endpoint details not set correctly"<<endl;
exit(0);
}
#ifdef WIN32
/*Windows specific code comes here */
HANDLE hThread[NUM_THREADS];
DWORD dwThreadId;
DWORD (_stdcall *fnptr[5])(LPVOID p)={calThreadFunc,arrayDocThreadFunc,mathOpsThreadFunc,simpleTypeThreadFunc};
//char endpoint[50];
for(i=0;i<NUM_THREADS;i++){
hThread[i] = CreateThread(
NULL, // no security attributes
0, // use default stack size
fnptr[i%4], // thread function
LPVOID(endpoint_list[i%4]), // argument to thread function
0,
&dwThreadId); // returns the thread identifier
if (hThread[i] == NULL)
{
cout<<"Thread creation Failed";
}
}
/* Waiting for threads to terminate */
WaitForMultipleObjects(NUM_THREADS,hThread,true, INFINITE);
for(i=0;i<NUM_THREADS;i++)
CloseHandle( hThread[i] );
#else
void *(*fnptr[5])(void * p)={calThreadFunc,arrayDocThreadFunc,mathOpsThreadFunc,simpleTypeThreadFunc};
pthread_t thread[NUM_THREADS];
pthread_attr_t attr;
int rc, t, status = 0;
// Initialize and set thread detached attribute
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
for (t = 0; t < NUM_THREADS; t++)
{
/*Creating threads */
rc = pthread_create(&thread[t], &attr, fnptr[t%4],(void *)endpoint_list[t%4]);
if (rc)
{
cout<<"Thread Creation Failed";
}
}
//Free attribute and wait for the other threads
pthread_attr_destroy(&attr);
/* Wait for the threads to terminate */
for(t=0;t<NUM_THREADS;t++){
rc = pthread_join(thread[t], (void **)&status);
if (rc)
{
cout<<"ERROR from pthread_join()"<<endl;
}
}
#endif
}catch(exception &e){
cout<< e.what();
}catch(...){
cout<<" Endpoints are not set correctly. There should be 4 endpoint elements in test.xml file" << endl;
}
cout<<endl <<"----------------------------------TEST COMPLETE--------------------------------"<<endl;
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/DivByZeroStruct.hpp
Index: DivByZeroStruct.hpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type DivByZeroStruct
*/
#if !defined(__DIVBYZEROSTRUCT_PARAM_H__INCLUDED_)
#define __DIVBYZEROSTRUCT_PARAM_H__INCLUDED_
#include <axis/AxisUserAPI.hpp>
#include <axis/SoapFaultException.hpp>
AXIS_CPP_NAMESPACE_USE
/*Local name and the URI for the type*/
static const char* Axis_URI_DivByZeroStruct = "http://soapinterop.org";
static const char* Axis_TypeName_DivByZeroStruct = "DivByZeroStruct";
class STORAGE_CLASS_INFO DivByZeroStruct : public SoapFaultException
{
public:
xsd__string varString;
xsd__int varInt;
xsd__float varFloat;
DivByZeroStruct();
~DivByZeroStruct() throw();
};
#endif /* !defined(__DIVBYZEROSTRUCT_PARAM_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/SimpleTypeArrayWS.hpp
Index: SimpleTypeArrayWS.hpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub Class for remote web service
*/
#if !defined(__SIMPLETYPEARRAYWS_CLIENTSTUB_H__INCLUDED_)
#define __SIMPLETYPEARRAYWS_CLIENTSTUB_H__INCLUDED_
#include <axis/client/Stub.hpp>
#include <axis/OtherFaultException.hpp>
#include <axis/ISoapFault.hpp>
AXIS_CPP_NAMESPACE_USE
#include "Type.hpp"
class SimpleTypeArrayWS :public Stub
{
public:
STORAGE_CLASS_INFO SimpleTypeArrayWS(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);
STORAGE_CLASS_INFO SimpleTypeArrayWS();
public:
STORAGE_CLASS_INFO virtual ~SimpleTypeArrayWS();
public:
STORAGE_CLASS_INFO void SetSecure( char *, ...);
STORAGE_CLASS_INFO Type* getInput(Type* Value0);
private:
void includeSecure();
protected:
std::string sArguments[8];
};
#endif /* !defined(__SIMPLETYPEARRAYWS_CLIENTSTUB_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/Type.hpp
Index: Type.hpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type Type
*/
#if !defined(__TYPE_PARAM_H__INCLUDED_)
#define __TYPE_PARAM_H__INCLUDED_
#include <axis/AxisUserAPI.hpp>
AXIS_CPP_NAMESPACE_USE
/*Local name and the URI for the type*/
static const char* Axis_URI_Type = "http://simpletypearray.test.apache.org";
static const char* Axis_TypeName_Type = "Type";
class STORAGE_CLASS_INFO Type
{
public:
xsd__int_Array item;
Type();
~Type();
};
#endif /* !defined(__TYPE_PARAM_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/ArrayTestPortType.cpp
Index: ArrayTestPortType.cpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub implementation for remote web service.
*/
#include "ArrayTestPortType.hpp"
#include <axis/AxisWrapperAPI.hpp>
extern int Axis_DeSerialize_IntArrayType(IntArrayType* param, IWrapperSoapDeSerializer* pDZ);
extern void* Axis_Create_IntArrayType(IntArrayType *Obj, bool bArray = false, int nSize=0);
extern void Axis_Delete_IntArrayType(IntArrayType* param, bool bArray = false, int nSize=0);
extern int Axis_Serialize_IntArrayType(IntArrayType* param, IWrapperSoapSerializer* pSZ, bool bArray = false);
extern int Axis_GetSize_IntArrayType();
ArrayTestPortType::ArrayTestPortType(const char* pcEndpointUri, AXIS_PROTOCOL_TYPE eProtocol):Stub(pcEndpointUri, eProtocol)
{
}
ArrayTestPortType::ArrayTestPortType()
:Stub(" ", APTHTTP1_1)
{
m_pCall->setEndpointURI("http://localhost/axis/array");
}
ArrayTestPortType::~ArrayTestPortType()
{
}
/*Methods corresponding to the web service methods*/
/*
* This method wrap the service methodechoIntArray
*/
IntArrayType* ArrayTestPortType::echoIntArray(IntArrayType* Value0)
{
IntArrayType* pReturn = NULL;
const char* pcCmplxFaultName;
pcCmplxFaultName = NULL;
try
{ if (AXIS_SUCCESS != m_pCall->initialize(CPP_DOC_PROVIDER)) return pReturn;
if (NULL==m_pCall->getTransportProperty("SOAPAction",false))
{
m_pCall->setTransportProperty(SOAPACTION_HEADER , "");
}
m_pCall->setSOAPVersion(SOAP_VER_1_1);
m_pCall->setOperation("echoIntArray", "http://soapinterop.org");
includeSecure();
applyUserPreferences();
char cPrefixAndParamName0[17];
sprintf( cPrefixAndParamName0, "%s:arg_0_0", m_pCall->getNamespacePrefix("http://soapinterop.org"));
m_pCall->addCmplxParameter(Value0, (void*)Axis_Serialize_IntArrayType, (void*)Axis_Delete_IntArrayType, cPrefixAndParamName0, Axis_URI_IntArrayType);
if (AXIS_SUCCESS == m_pCall->invoke())
{
if(AXIS_SUCCESS == m_pCall->checkMessage("echoIntArrayResponse", "http://soapinterop.org"))
{
pReturn = (IntArrayType*)m_pCall->getCmplxObject((void*) Axis_DeSerialize_IntArrayType, (void*) Axis_Create_IntArrayType, (void*) Axis_Delete_IntArrayType,"echoIntArrayReturn", 0);
}
}
m_pCall->unInitialize();
return pReturn;
}
catch(AxisException& e)
{
int iExceptionCode = e.getExceptionCode();
if(AXISC_NODE_VALUE_MISMATCH_EXCEPTION != iExceptionCode)
{
m_pCall->unInitialize();
throw;
}
ISoapFault* pSoapFault = (ISoapFault*)
m_pCall->checkFault("Fault","http://localhost/axis/array" );
if(pSoapFault)
{
const char *detail = pSoapFault->getSimpleFaultDetail();
bool deleteDetail=false;
if (NULL==detail || 0==strlen(detail))
{
detail=m_pCall->getFaultAsXMLString();
if (NULL==detail)
{
detail="";
}
else
{
deleteDetail=true;
}
}
OtherFaultException ofe(pSoapFault->getFaultcode(),
pSoapFault->getFaultstring(), pSoapFault->getFaultactor(),
detail, iExceptionCode);
if (deleteDetail && NULL!=detail)
{
delete [] const_cast<char*>(detail);
}
m_pCall->unInitialize();
throw ofe;
}
else
{
m_pCall->unInitialize();
throw;
}
}
}
/*Methods for supporting SecureChannel*/
void ArrayTestPortType::SetSecure( char * pszArguments, ...)
{
int iArgIndex = 0;
va_list args;
char * pszArg = NULL;
va_start( args, pszArguments);
if( (pszArg = pszArguments) != NULL)
{
do
{
if( pszArg == (char *) 1)
{
sArguments[iArgIndex] = "true";
}
else
{
sArguments[iArgIndex] = pszArg;
}
iArgIndex++;
} while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
if( iArgIndex == 6)
{
sArguments[iArgIndex] = "false";
}
}
va_end( args);
}
void ArrayTestPortType::includeSecure()
{
m_pCall->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments);
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/MathOps.hpp
Index: MathOps.hpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub Class for remote web service
*/
#if !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)
#define __MATHOPS_CLIENTSTUB_H__INCLUDED_
#include <axis/client/Stub.hpp>
#include <axis/OtherFaultException.hpp>
#include <axis/ISoapFault.hpp>
AXIS_CPP_NAMESPACE_USE
#include "DivByZeroStruct.hpp"
class MathOps :public Stub
{
public:
STORAGE_CLASS_INFO MathOps(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);
STORAGE_CLASS_INFO MathOps();
public:
STORAGE_CLASS_INFO virtual ~MathOps();
public:
STORAGE_CLASS_INFO void SetSecure( char *, ...);
STORAGE_CLASS_INFO xsd__int div(xsd__int Value0, xsd__int Value1);
private:
void includeSecure();
protected:
std::string sArguments[8];
};
#endif /* !defined(__MATHOPS_CLIENTSTUB_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/Type.cpp
Index: Type.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type Type
*/
#include <axis/AxisWrapperAPI.hpp>
#include "Type.hpp"
/*
* This static method serialize a Type type of object
*/
int Axis_Serialize_Type(Type* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
if ( param == NULL )
{
/* TODO : may need to check nillable value - Now done*/
pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN);
pSZ->serialize( ">", NULL);
return AXIS_SUCCESS;
}
/* first serialize attributes if any*/
pSZ->serialize( ">", 0);
/* then serialize elements if any*/
pSZ->serializeBasicArray((Axis_Array*)(¶m->item), Axis_URI_Type,XSD_INT, "item");
return AXIS_SUCCESS;
}
/*
* This static method deserialize a Type type of object
*/
int Axis_DeSerialize_Type(Type* param, IWrapperSoapDeSerializer* pIWSDZ)
{
Axis_Array array;
array = pIWSDZ->getBasicArray(XSD_INT, "item",0);
param->item.m_Array = (xsd__int**)new xsd__int*[array.m_Size];
param->item.m_Size = array.m_Size;
memcpy( param->item.m_Array, array.m_Array, sizeof( xsd__int) * array.m_Size);
return pIWSDZ->getStatus();
}
void* Axis_Create_Type(Type* pObj, bool bArray = false, int nSize=0)
{
if (bArray && (nSize > 0))
{
if (pObj)
{
Type* pNew = new Type[nSize];
memcpy(pNew, pObj, sizeof(Type)*nSize/2);
memset(pObj, 0, sizeof(Type)*nSize/2);
delete [] pObj;
return pNew;
}
else
{
return new Type[nSize];
}
}
else
return new Type;
}
/*
* This static method delete a Type type of object
*/
void Axis_Delete_Type(Type* param, bool bArray = false, int nSize=0)
{
if (bArray)
{
delete [] param;
}
else
{
delete param;
}
}
/*
* This static method gives the size of Type type of object
*/
int Axis_GetSize_Type()
{
return sizeof(Type);
}
Type::Type()
{
/*do not allocate memory to any pointer members here
because deserializer will allocate memory anyway. */
item.m_Array = 0;
item.m_Size = 0;
}
Type::~Type()
{
/*delete any pointer and array members here*/
}
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/Calculator.hpp
Index: Calculator.hpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Client Stub Class for remote web service
*/
#if !defined(__CALCULATOR_CLIENTSTUB_H__INCLUDED_)
#define __CALCULATOR_CLIENTSTUB_H__INCLUDED_
#include <axis/client/Stub.hpp>
#include <axis/OtherFaultException.hpp>
#include <axis/ISoapFault.hpp>
AXIS_CPP_NAMESPACE_USE
class Calculator :public Stub
{
public:
STORAGE_CLASS_INFO Calculator(const char* pchEndpointUri, AXIS_PROTOCOL_TYPE eProtocol=APTHTTP1_1);
STORAGE_CLASS_INFO Calculator();
public:
STORAGE_CLASS_INFO virtual ~Calculator();
public:
STORAGE_CLASS_INFO void SetSecure( char *, ...);
STORAGE_CLASS_INFO xsd__int add(xsd__int Value0, xsd__int Value1);
STORAGE_CLASS_INFO xsd__int sub(xsd__int Value0, xsd__int Value1);
STORAGE_CLASS_INFO xsd__int mul(xsd__int Value0, xsd__int Value1);
STORAGE_CLASS_INFO xsd__int div(xsd__int Value0, xsd__int Value1);
private:
void includeSecure();
protected:
std::string sArguments[8];
};
#endif /* !defined(__CALCULATOR_CLIENTSTUB_H__INCLUDED_)*/
1.1 ws-axis/c/tests/auto_build/testcases/dynamic/Combo_TTest/DivByZeroStruct.cpp
Index: DivByZeroStruct.cpp
===================================================================
/*
* Copyright 2003-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains functions to manipulate complex type DivByZeroStruct
*/
#include <axis/AxisWrapperAPI.hpp>
#include "DivByZeroStruct.hpp"
/*
* This static method serialize a DivByZeroStruct type of object
*/
int Axis_Serialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
{
if ( param == NULL )
{
/* TODO : may need to check nillable value - Now done*/
pSZ->serializeAsAttribute( "xsi:nil", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN);
pSZ->serialize( ">", NULL);
return AXIS_SUCCESS;
}
/* first serialize attributes if any*/
pSZ->serialize( ">", 0);
/* then serialize elements if any*/
pSZ->serializeAsElement("varString", Axis_URI_DivByZeroStruct, (void*)(param->varString), XSD_STRING);
pSZ->serializeAsElement("varInt", Axis_URI_DivByZeroStruct, (void*)&(param->varInt), XSD_INT);
pSZ->serializeAsElement("varFloat", Axis_URI_DivByZeroStruct, (void*)&(param->varFloat), XSD_FLOAT);
return AXIS_SUCCESS;
}
/*
* This static method deserialize a DivByZeroStruct type of object
*/
int Axis_DeSerialize_DivByZeroStruct(DivByZeroStruct* param, IWrapperSoapDeSerializer* pIWSDZ)
{
param->varString = pIWSDZ->getElementAsString( "varString",0);
xsd__int * varInt = NULL;
if ((varInt = pIWSDZ->getElementAsInt( "varInt",0)) != NULL)
param->varInt = *( varInt );
xsd__float * varFloat = NULL;
if ((varFloat = pIWSDZ->getElementAsFloat( "varFloat",0)) != NULL)
param->varFloat = *( varFloat );
return pIWSDZ->getStatus();
}
void* Axis_Create_DivByZeroStruct(DivByZeroStruct* pObj, bool bArray = false, int nSize=0)
{
if (bArray && (nSize > 0))
{
if (pObj)
{
DivByZeroStruct* pNew = new DivByZeroStruct[nSize];
memcpy(pNew, pObj, sizeof(DivByZeroStruct)*nSize/2);
memset(pObj, 0, sizeof(DivByZeroStruct)*nSize/2);
delete [] pObj;
return pNew;
}
else
{
return new DivByZeroStruct[nSize];
}
}
else
return new DivByZeroStruct;
}
/*
* This static method delete a DivByZeroStruct type of object
*/
void Axis_Delete_DivByZeroStruct(DivByZeroStruct* param, bool bArray = false, int nSize=0)
{
if (bArray)
{
delete [] param;
}
else
{
delete param;
}
}
/*
* This static method gives the size of DivByZeroStruct type of object
*/
int Axis_GetSize_DivByZeroStruct()
{
return sizeof(DivByZeroStruct);
}
DivByZeroStruct::DivByZeroStruct()
{
/*do not allocate memory to any pointer members here
because deserializer will allocate memory anyway. */
memset( &varString, 0, sizeof( xsd__string));
memset( &varInt, 0, sizeof( xsd__int));
memset( &varFloat, 0, sizeof( xsd__float));
}
DivByZeroStruct::~DivByZeroStruct() throw ()
{
/*delete any pointer and array members here*/
}