blob: 9c9d32c342d221c1a0e36facfbeee12031986452 [file] [log] [blame]
/*
* 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>
#include <axis/Axis.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;
Axis::AxisDelete( (void *) pReturn, XSD_INT);
}
}
}
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();
delete pSoapFault;
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();
delete pSoapFault;
throw ofe;
}
}
else
{
m_pCall->unInitialize();
delete pSoapFault;
throw;
}
}
}