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 ni...@apache.org on 2005/02/22 04:28:39 UTC
cvs commit: ws-axis/c/samples/server/simple AxisServiceException.hpp Calculator.hpp CalculatorWrapper.hpp Calculator.cpp CalculatorService.cpp CalculatorWrapper.cpp deploy.wsdd
nithya 2005/02/21 19:28:39
Modified: c/samples/server/simple Calculator.cpp CalculatorService.cpp
CalculatorWrapper.cpp deploy.wsdd
Added: c/samples/server/simple AxisServiceException.hpp
Calculator.hpp CalculatorWrapper.hpp
Log:
Revision Changes Path
1.2 +1 -1 ws-axis/c/samples/server/simple/Calculator.cpp
Index: Calculator.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/simple/Calculator.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Calculator.cpp 8 Apr 2004 13:23:52 -0000 1.1
+++ Calculator.cpp 22 Feb 2005 03:28:39 -0000 1.2
@@ -3,7 +3,7 @@
* Calculator.cpp: implemtation for the Calculator.
*
*/
-#include "Calculator.h"
+#include "Calculator.hpp"
Calculator::Calculator()
1.4 +5 -3 ws-axis/c/samples/server/simple/CalculatorService.cpp
Index: CalculatorService.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/simple/CalculatorService.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CalculatorService.cpp 14 Jun 2004 08:00:46 -0000 1.3
+++ CalculatorService.cpp 22 Feb 2005 03:28:39 -0000 1.4
@@ -1,7 +1,9 @@
-/*This file is automatically generated by the Axis C++ Wrapper Class Generator
- *Service file containing the two export functions of the Web service Library*/
+/*
+ * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
+ * This file contains the two export functions of the Web service Dynamic Library
+ */
-#include "CalculatorWrapper.h"
+#include "CalculatorWrapper.hpp"
extern "C" {
STORAGE_CLASS_INFO
int GetClassInstance(BasicHandler **inst)
1.5 +50 -28 ws-axis/c/samples/server/simple/CalculatorWrapper.cpp
Index: CalculatorWrapper.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/simple/CalculatorWrapper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CalculatorWrapper.cpp 10 May 2004 04:21:09 -0000 1.4
+++ CalculatorWrapper.cpp 22 Feb 2005 03:28:39 -0000 1.5
@@ -1,10 +1,9 @@
/*
- * This is the Service implementation CPP file genarated by theWSDL2Ws.
- * CalculatorWrapper.cpp: implemtation for the CalculatorWrapper.
- *
+ * This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
+ * This file contains Web Service Wrapper implementations
*/
-#include "CalculatorWrapper.h"
+#include "CalculatorWrapper.hpp"
CalculatorWrapper::CalculatorWrapper()
{
@@ -19,15 +18,18 @@
/*implementation of WrapperClassHandler interface*/
void CalculatorWrapper::onFault(void *pMsg)
{
+ pWs->onFault();
}
int CalculatorWrapper::init()
{
+ pWs->init();
return AXIS_SUCCESS;
}
int CalculatorWrapper::fini()
{
+ pWs->fini();
return AXIS_SUCCESS;
}
@@ -60,20 +62,25 @@
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
- IWrapperSoapSerializer *pIWSSZ = NULL;
+ IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
- IWrapperSoapDeSerializer *pIWSDZ = NULL;
+ IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ) return AXIS_FAIL;
/* check whether we have got correct message */
if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("add", "http://localhost/axis/Calculator")) return AXIS_FAIL;
pIWSSZ->createSoapMethod("addResponse", "http://localhost/axis/Calculator");
- int v0 = pIWSDZ->getElementAsInt("in0",0);
- int v1 = pIWSDZ->getElementAsInt("in1",0);
+ xsd__int v0 = *(pIWSDZ->getElementAsInt("in0",0));
+ xsd__int v1 = *(pIWSDZ->getElementAsInt("in1",0));
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus())) return nStatus;
- int ret = pWs->add(v0,v1);
- return pIWSSZ->addOutputParam("addReturn", (void*)&ret, XSD_INT);
+ try
+ {
+ xsd__int ret = pWs->add(v0,v1);
+ return pIWSSZ->addOutputParam("addReturn", (void*)&ret, XSD_INT);
+ }
+ catch(...){
+ }
}
@@ -84,20 +91,25 @@
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
- IWrapperSoapSerializer *pIWSSZ = NULL;
+ IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
- IWrapperSoapDeSerializer *pIWSDZ = NULL;
+ IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ) return AXIS_FAIL;
/* check whether we have got correct message */
if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("sub", "http://localhost/axis/Calculator")) return AXIS_FAIL;
pIWSSZ->createSoapMethod("subResponse", "http://localhost/axis/Calculator");
- int v0 = pIWSDZ->getElementAsInt("in0",0);
- int v1 = pIWSDZ->getElementAsInt("in1",0);
+ xsd__int v0 = *(pIWSDZ->getElementAsInt("in0",0));
+ xsd__int v1 = *(pIWSDZ->getElementAsInt("in1",0));
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus())) return nStatus;
- int ret = pWs->sub(v0,v1);
- return pIWSSZ->addOutputParam("subReturn", (void*)&ret, XSD_INT);
+ try
+ {
+ xsd__int ret = pWs->sub(v0,v1);
+ return pIWSSZ->addOutputParam("subReturn", (void*)&ret, XSD_INT);
+ }
+ catch(...){
+ }
}
@@ -108,20 +120,25 @@
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
- IWrapperSoapSerializer *pIWSSZ = NULL;
+ IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
- IWrapperSoapDeSerializer *pIWSDZ = NULL;
+ IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ) return AXIS_FAIL;
/* check whether we have got correct message */
if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("mul", "http://localhost/axis/Calculator")) return AXIS_FAIL;
pIWSSZ->createSoapMethod("mulResponse", "http://localhost/axis/Calculator");
- int v0 = pIWSDZ->getElementAsInt("in0",0);
- int v1 = pIWSDZ->getElementAsInt("in1",0);
+ xsd__int v0 = *(pIWSDZ->getElementAsInt("in0",0));
+ xsd__int v1 = *(pIWSDZ->getElementAsInt("in1",0));
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus())) return nStatus;
- int ret = pWs->mul(v0,v1);
- return pIWSSZ->addOutputParam("mulReturn", (void*)&ret, XSD_INT);
+ try
+ {
+ xsd__int ret = pWs->mul(v0,v1);
+ return pIWSSZ->addOutputParam("mulReturn", (void*)&ret, XSD_INT);
+ }
+ catch(...){
+ }
}
@@ -132,19 +149,24 @@
{
IMessageData* mc = (IMessageData*)pMsg;
int nStatus;
- IWrapperSoapSerializer *pIWSSZ = NULL;
+ IWrapperSoapSerializer* pIWSSZ = NULL;
mc->getSoapSerializer(&pIWSSZ);
if (!pIWSSZ) return AXIS_FAIL;
- IWrapperSoapDeSerializer *pIWSDZ = NULL;
+ IWrapperSoapDeSerializer* pIWSDZ = NULL;
mc->getSoapDeSerializer(&pIWSDZ);
if (!pIWSDZ) return AXIS_FAIL;
/* check whether we have got correct message */
if (AXIS_SUCCESS != pIWSDZ->checkMessageBody("div", "http://localhost/axis/Calculator")) return AXIS_FAIL;
pIWSSZ->createSoapMethod("divResponse", "http://localhost/axis/Calculator");
- int v0 = pIWSDZ->getElementAsInt("in0",0);
- int v1 = pIWSDZ->getElementAsInt("in1",0);
+ xsd__int v0 = *(pIWSDZ->getElementAsInt("in0",0));
+ xsd__int v1 = *(pIWSDZ->getElementAsInt("in1",0));
if (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus())) return nStatus;
- int ret = pWs->div(v0,v1);
- return pIWSSZ->addOutputParam("divReturn", (void*)&ret, XSD_INT);
+ try
+ {
+ xsd__int ret = pWs->div(v0,v1);
+ return pIWSSZ->addOutputParam("divReturn", (void*)&ret, XSD_INT);
+ }
+ catch(...){
+ }
}
1.2 +2 -2 ws-axis/c/samples/server/simple/deploy.wsdd
Index: deploy.wsdd
===================================================================
RCS file: /home/cvs/ws-axis/c/samples/server/simple/deploy.wsdd,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- deploy.wsdd 8 Apr 2004 13:23:52 -0000 1.1
+++ deploy.wsdd 22 Feb 2005 03:28:39 -0000 1.2
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:CPP="http://xml.apache.org/axis/wsdd/providers/CPP">
- <service name="Calculator" provider="CPP:RPC" description="Simple Calculator Axis C++ web service">
- <parameter name="className" value="/user/local/apache/axis/CalculatorService.so"/>
+ <service name="Calculator" provider="CPP:RPC" description="Axis C++ web service">
+ <parameter name="className" value="/user/local/apache/axis/Calculator.so"/>
<parameter name="allowedMethods" value="add sub mul div "/>
</service>
</deployment>
1.1 ws-axis/c/samples/server/simple/AxisServiceException.hpp
Index: AxisServiceException.hpp
===================================================================
/*
* 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(__AXISSERVICEEXCEPTION_EXCEPTION_H__INCLUDED_)
#define __AXISSERVICEEXCEPTION_EXCEPTION_H__INCLUDED_
#include <string>
#include <exception>
#include <axis/AxisException.hpp>
#include <axis/ISoapFault.hpp>
using namespace std;
AXIS_CPP_NAMESPACE_USE
class AxisServiceException: public AxisException
{
public:
STORAGE_CLASS_INFO AxisServiceException();
STORAGE_CLASS_INFO AxisServiceException(ISoapFault* pFault);
STORAGE_CLASS_INFO AxisServiceException(int iExceptionCode);
STORAGE_CLASS_INFO AxisServiceException(exception* e);
STORAGE_CLASS_INFO AxisServiceException(exception* e, int iExceptionCode);
STORAGE_CLASS_INFO AxisServiceException(string sMessage);
STORAGE_CLASS_INFO virtual ~AxisServiceException() throw();
STORAGE_CLASS_INFO const char* what() throw();
STORAGE_CLASS_INFO const int getExceptionCode();
STORAGE_CLASS_INFO const string getMessage(exception* e);
STORAGE_CLASS_INFO const string getMessage(int iExceptionCode);
STORAGE_CLASS_INFO const ISoapFault* getFault();
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;
ISoapFault* m_pISoapFault;
};
#endif /* !defined(__AXISSERVICEEXCEPTION_EXCEPTION_H__INCLUDED_)*/
1.1 ws-axis/c/samples/server/simple/Calculator.hpp
Index: Calculator.hpp
===================================================================
/*
* This is the Service Class genarated by the tool WSDL2Ws
* Calculator.hpp: interface for the Calculatorclass.
*
*/
#if !defined(__CALCULATOR_SERVERSKELETON_H__INCLUDED_)
#define __CALCULATOR_SERVERSKELETON_H__INCLUDED_
#include <axis/AxisUserAPI.hpp>
#include "AxisServiceException.hpp"
class Calculator
{
public:
Calculator();
public:
virtual ~Calculator();
public:
void onFault();
void init();
void fini();
xsd__int add(xsd__int Value0,xsd__int Value1);
xsd__int sub(xsd__int Value0,xsd__int Value1);
xsd__int mul(xsd__int Value0,xsd__int Value1);
xsd__int div(xsd__int Value0,xsd__int Value1);
};
#endif /* !defined(__CALCULATOR_SERVERSKELETON_H__INCLUDED_)*/
1.1 ws-axis/c/samples/server/simple/CalculatorWrapper.hpp
Index: CalculatorWrapper.hpp
===================================================================
/*
* This file was auto-generated by the Axis C++ Web Service Generator (WSDL2Ws)
* This file contains Web Service Wrapper declarations
*/
#if !defined(__CALCULATORWRAPPER_SERVERWRAPPER_H__INCLUDED_)
#define __CALCULATORWRAPPER_SERVERWRAPPER_H__INCLUDED_
#include "Calculator.hpp"
#include <axis/server/WrapperClassHandler.hpp>
#include <axis/IMessageData.hpp>
#include <axis/GDefine.hpp>
#include <axis/AxisWrapperAPI.hpp>
#include "AxisServiceException.hpp"
AXIS_CPP_NAMESPACE_USE
class CalculatorWrapper : public WrapperClassHandler
{
private:/* Actual web service object*/
Calculator *pWs;
public:
CalculatorWrapper();
public:
virtual ~CalculatorWrapper();
public:/*implementation of WrapperClassHandler interface*/
int AXISCALL invoke(void* pMsg);
void AXISCALL onFault(void* pMsg);
int AXISCALL init();
int AXISCALL fini();
AXIS_BINDING_STYLE AXISCALL getBindingStyle(){return RPC_ENCODED;};
private:/*Methods corresponding to the web service methods*/
int add(void* pMsg);
int sub(void* pMsg);
int mul(void* pMsg);
int div(void* pMsg);
};
#endif /* !defined(__CALCULATORWRAPPER_SERVERWRAPPER_H__INCLUDED_)*/