summaryrefslogtreecommitdiffstats
path: root/tags/cpp-sca-20060405/runtime/axis_binding/wrapper/src/AxisServiceException.cpp
blob: d23689ad9d564e2113caf5067b5881195ebadba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
 * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
 * This file contains implementations of the Exception class of the web service.
 */

#include "AxisServiceException.h"

#include <axis/AxisWrapperAPI.hpp>

AxisServiceException::AxisServiceException()
{
/* This only serves the purpose 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;
	m_pISoapFault = pFault;
	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(string sMessage)
{
	 m_sMessage =sMessage;
}

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

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

void AxisServiceException::processException (ISoapFault* pFault)
{
	/*User can do something like deserializing the struct into a string*/
}

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 = "The service has thrown an exception. see details";
		break;
		default:
		sMessage = "Unknown Exception has occured in the service";
	}
return sMessage;
}

const char* AxisServiceException::what() throw ()
{
	return m_sMessage.c_str ();
}

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

const ISoapFault* AxisServiceException::getFault(){
	return m_pISoapFault;
}