You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2004/08/12 15:41:22 UTC
cvs commit: ws-axis/c/samples/client/interoptests/groupB AxisClientException.h AxisClientException.cpp
sanjaya 2004/08/12 06:41:22
Added: c/samples/client/interoptests/groupB AxisClientException.h
AxisClientException.cpp
Log:
Added AxisClientException files need to compile interop groupb client
Revision Changes Path
1.1 ws-axis/c/samples/client/interoptests/groupB/AxisClientException.h
Index: AxisClientException.h
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains an Exception class of the web service.
*/
#if !defined(__AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_)
#define __AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_
#include <string>
#include <exception>
#include <axis/server/AxisException.h>
#include <axis/ISoapFault.h>
using namespace std;
AXIS_CPP_NAMESPACE_USE
class AxisClientException: public AxisException
{
public:
AxisClientException();
AxisClientException(ISoapFault* pFault);
AxisClientException(int iExceptionCode);
AxisClientException(exception* e);
AxisClientException(exception* e, int iExceptionCode);
virtual ~AxisClientException() throw();
const char* what() throw();
const int getExceptionCode();
const string getMessage(exception* e);
const string getMessage(int iExceptionCode);
private:
void processException(exception* e);
void processException(ISoapFault* pFault);
void processException(exception* e, int iExceptionCode);
void processException(int iExceptionCode);
string m_sMessage;
int m_iExceptionCode;
};
#endif /* !defined(__AXISCLIENTEXCEPTION_EXCEPTION_H__INCLUDED_)*/
1.1 ws-axis/c/samples/client/interoptests/groupB/AxisClientException.cpp
Index: AxisClientException.cpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains implementations of an Exception class of the web service.
*/
#include "AxisClientException.h"
#include <axis/server/AxisWrapperAPI.h>
AxisClientException::AxisClientException()
{
/* This only serves the pupose of indicating that the
* service has thrown an excpetion
*/
m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;
processException(m_iExceptionCode);
}
AxisClientException::AxisClientException(ISoapFault* pFault)
{
m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;
processException(pFault);}
AxisClientException::AxisClientException(int iExceptionCode)
{
m_iExceptionCode = iExceptionCode;
processException (iExceptionCode);
}
AxisClientException::AxisClientException(exception* e)
{
processException (e);
}
AxisClientException::AxisClientException(exception* e,int iExceptionCode)
{
processException (e, iExceptionCode);
}
AxisClientException::~AxisClientException() throw ()
{
m_sMessage ="";
}
void AxisClientException:: processException(exception* e, int iExceptionCode)
{
m_sMessage = getMessage (e) + getMessage (iExceptionCode);
}
void AxisClientException::processException (ISoapFault* pFault)
{
/*User can do something like deserializing the struct into a string*/
}
void AxisClientException::processException(exception* e)
{
m_sMessage = getMessage (e);
}
void AxisClientException::processException(int iExceptionCode)
{
m_sMessage = getMessage (iExceptionCode);
}
const string AxisClientException::getMessage (exception* objException)
{
string sMessage = objException->what();
return sMessage;
}
const string AxisClientException::getMessage (int iExceptionCode)
{
string sMessage;
switch(iExceptionCode)
{
case AXISC_SERVICE_THROWN_EXCEPTION:
sMessage = "A service has thrown an exception. see detail";
break;
default:
sMessage = "Unknown Exception has occured";
}
return sMessage;
}
const char* AxisClientException::what() throw ()
{
return m_sMessage.c_str ();
}
const int AxisClientException::getExceptionCode(){
return m_iExceptionCode;
}