/*
 * 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 "AxisServiceException.h"


AxisServiceException::AxisServiceException()
{
/* This only serves the pupose of indicating that the 
 * service has thrown an excpetion 
 */ 
	m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION; 
	processException(m_iExceptionCode); 
}

AxisServiceException::AxisServiceException(ISoapFault* pFault)
{
	m_iExceptionCode = AXISC_SERVICE_THROWN_EXCEPTION;
	processException(pFault);}

AxisServiceException::AxisServiceException(int iExceptionCode)
{

	m_iExceptionCode = iExceptionCode;
	processException (iExceptionCode);
}

AxisServiceException::AxisServiceException(exception* e)
{
	processException (e);
}

AxisServiceException::AxisServiceException(exception* e,int iExceptionCode)
{

	processException (e, iExceptionCode);
}

AxisServiceException::~AxisServiceException() throw () 
{
	m_sMessage ="";
}

void AxisServiceException:: processException(exception* e, int iExceptionCode)
{
	m_sMessage = getMessage (e) + getMessage (iExceptionCode);
}

void AxisServiceException::processException (ISoapFault* pFault)
{	
}

void AxisServiceException::processException(exception* e)
{
	m_sMessage = getMessage (e);
}

void AxisServiceException::processException(int iExceptionCode)
{
	m_sMessage = getMessage (iExceptionCode);
}

const string AxisServiceException::getMessage (exception* objException)
{
	string sMessage = objException->what();
	return sMessage;
}

const string AxisServiceException::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* AxisServiceException::what() throw ()
{
	return m_sMessage.c_str ();
}

const int AxisServiceException::getExceptionCode(){
	return m_iExceptionCode;
}

