ServiceSkeleton.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SERVICESKELETON_H
00018 #define SERVICESKELETON_H
00019
00020 #include <WSFDefines.h>
00021 #include <OMElement.h>
00022 #include <string>
00023 #include <MessageContext.h>
00024
00031 #define WSF_SERVICE_INIT(class_name) \
00032 extern "C" \
00033 {\
00034 \
00035 WSF_EXTERN int \
00036 axis2_get_instance( \
00037 ServiceSkeleton ** inst, \
00038 const axutil_env_t * env) \
00039 { \
00040 *inst = new class_name(); \
00041 if (!(*inst)) \
00042 { \
00043 return AXIS2_FAILURE; \
00044 } \
00045 \
00046 return AXIS2_SUCCESS; \
00047 } \
00048 \
00049 WSF_EXTERN int \
00050 axis2_remove_instance( \
00051 ServiceSkeleton * inst, \
00052 const axutil_env_t * env) \
00053 { \
00054 axis2_status_t status = AXIS2_SUCCESS; \
00055 if (inst) \
00056 { \
00057 delete inst; \
00058 } \
00059 return status; \
00060 } \
00061 \
00062 } \
00063
00064
00073 namespace wso2wsf
00074 {
00087 class WSF_EXTERN ServiceSkeleton
00088 {
00089 public:
00101 virtual OMElement* WSF_CALL invoke(OMElement* omEle, MessageContext *msgCtx){ return NULL;};
00102
00109 virtual OMElement* WSF_CALL onFault(OMElement* omEle){return NULL;};
00110
00114 virtual void WSF_CALL init(){};
00118 virtual WSF_CALL ~ServiceSkeleton();
00119 };
00122
00123 inline WSF_CALL ServiceSkeleton::~ServiceSkeleton()
00124 {}
00125 }
00126 #endif // SERVICESKELETON_H