You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by su...@apache.org on 2003/09/03 07:21:25 UTC

cvs commit: xml-axis/c/src/server/samples/cservicewrapper CServiceWrapper.cpp CServiceWrapper.hpp

susantha    2003/09/02 22:21:25

  Modified:    c/src/server/samples/cppservicewrapper CPPServiceWrapper.cpp
                        CPPServiceWrapper.hpp
               c/src/server/samples/cservicewrapper CServiceWrapper.cpp
                        CServiceWrapper.hpp
  Log:
  changed samples to reflect recent changes in the Axis code base
  
  Revision  Changes    Path
  1.2       +13 -14    xml-axis/c/src/server/samples/cppservicewrapper/CPPServiceWrapper.cpp
  
  Index: CPPServiceWrapper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/cppservicewrapper/CPPServiceWrapper.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CPPServiceWrapper.cpp	1 Sep 2003 13:36:15 -0000	1.1
  +++ CPPServiceWrapper.cpp	3 Sep 2003 05:21:25 -0000	1.2
  @@ -29,9 +29,9 @@
   	}
   	else
   	{
  -		AxisString sPrefix = pSZ.getNewNamespacePrefix();
  -		pSZ << "<" << Axis_TypeName_Point << " xsi:type=\"" << sPrefix.c_str() <<":" 
  -			<< Axis_TypeName_Point << " xmlns:" << sPrefix.c_str() << "=\"" 
  +		const AxisChar* sPrefix = pSZ.getNewNamespacePrefix();
  +		pSZ << "<" << Axis_TypeName_Point << " xsi:type=\"" << sPrefix <<":" 
  +			<< Axis_TypeName_Point << " xmlns:" << sPrefix << "=\"" 
   			<< Axis_URI_Point << "\">";
   	}
   	pSZ << pSZ.SerializeBasicType(L"x", p->x);
  @@ -130,14 +130,14 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	AxisString method = pIWSDZ->GetMethodName();
  -	if (method == L"Distance")
  +	const AxisChar* method = pIWSDZ->GetMethodName();
  +	if (0 == wcscmp(method, L"Distance"))
   		return Distance(mc);
  -	else if (method == L"AddPoint")
  +	else if (0 == wcscmp(method, L"AddPoint"))
   		return AddPoint(mc);
  -	else if (method == L"Add")
  +	else if (0 == wcscmp(method, L"Add"))
   		return Add(mc);
  -	else if (method == L"Perimeter")
  +	else if (0 == wcscmp(method, L"Perimeter"))
   		return Perimeter(mc);
   	else return FAIL;
   }
  @@ -158,12 +158,11 @@
   
   int CPPServiceWrapper::SetResponseMethod(IMessageData* mc, const AxisChar* name)
   {
  -	AxisString method = name;
   	IWrapperSoapSerializer* pIWSSZ = NULL;
   	mc->getSoapSerializer(&pIWSSZ);
   	if (!pIWSSZ) return FAIL;
   	ISoapMethod* pMethod = pIWSSZ->createSoapMethod();
  -	pMethod->setLocalName(method + L"Response");
  +	pMethod->setLocalName(name);
   	pMethod->setPrefix(pIWSSZ->getNewNamespacePrefix());
   	pMethod->setUri(L"http://www.opensource.lk/CPPService");
   	return SUCCESS;
  @@ -177,7 +176,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Distance");
  +	SetResponseMethod(mc, L"DistanceResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Point* v0 = new Point();
  @@ -209,7 +208,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"AddPoint");
  +	SetResponseMethod(mc, L"AddPointResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Point* v0 = new Point();
  @@ -239,7 +238,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Add");
  +	SetResponseMethod(mc, L"AddResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	int v0 = param0->GetInt();
  @@ -265,7 +264,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Perimeter");
  +	SetResponseMethod(mc, L"PerimeterResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Triangle* v0 = new Triangle();
  
  
  
  1.2       +8 -10     xml-axis/c/src/server/samples/cppservicewrapper/CPPServiceWrapper.hpp
  
  Index: CPPServiceWrapper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/cppservicewrapper/CPPServiceWrapper.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CPPServiceWrapper.hpp	1 Sep 2003 13:36:15 -0000	1.1
  +++ CPPServiceWrapper.hpp	3 Sep 2003 05:21:25 -0000	1.2
  @@ -2,16 +2,14 @@
   #if !defined __WRAPPER_CLASS_CPPServiceWrapper_INCLUDED__
   #define __WRAPPER_CLASS_CPPServiceWrapper_INCLUDED__
   
  -#include "PPService.h"
  -#include <WrapperClassHandler.h>
  -#include <IMessageData.h>
  -#include <GDefine.h>
  -#include <IWrapperSoapDeSerializer.h>
  -#include <IWrapperSoapSerializer.h>
  -#include <ISoapMethod.h>
  -#include <IParam.h>
  -#include <string>
  -using namespace std;
  +#include "../cppservice/PPService.h"
  +#include "../../../common/WrapperClassHandler.h"
  +#include "../../../common/IMessageData.h"
  +#include "../../../common/GDefine.h"
  +#include "../../../common/IWrapperSoapDeSerializer.h"
  +#include "../../../common/IWrapperSoapSerializer.h"
  +#include "../../../common/ISoapMethod.h"
  +#include "../../../common/IParam.h"
   
   class CPPServiceWrapper : public WrapperClassHandler
   {
  
  
  
  1.2       +13 -15    xml-axis/c/src/server/samples/cservicewrapper/CServiceWrapper.cpp
  
  Index: CServiceWrapper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/cservicewrapper/CServiceWrapper.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CServiceWrapper.cpp	1 Sep 2003 13:36:34 -0000	1.1
  +++ CServiceWrapper.cpp	3 Sep 2003 05:21:25 -0000	1.2
  @@ -2,7 +2,6 @@
   //01 September 2003 by Susantha Kumara (susantha@opensource.lk, skumara@virtusa.com)
   
   #include "CServiceWrapper.hpp"
  -#include "Service.h"
   
   extern "C" int AddInt(int a, int b);
   extern "C" double Distance(Point *p1, Point *p2);
  @@ -36,9 +35,9 @@
   	}
   	else
   	{
  -		AxisString sPrefix = pSZ.getNewNamespacePrefix();
  -		pSZ << "<" << Axis_TypeName_Point << " xsi:type=\"" << sPrefix.c_str() <<":" 
  -			<< Axis_TypeName_Point << " xmlns:" << sPrefix.c_str() << "=\"" 
  +		const AxisChar* sPrefix = pSZ.getNewNamespacePrefix();
  +		pSZ << "<" << Axis_TypeName_Point << " xsi:type=\"" << sPrefix <<":" 
  +			<< Axis_TypeName_Point << " xmlns:" << sPrefix << "=\"" 
   			<< Axis_URI_Point << "\">";
   	}
   	pSZ << pSZ.SerializeBasicType(L"x", p->x);
  @@ -137,14 +136,14 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	AxisString method = pIWSDZ->GetMethodName();
  -	if (method == L"Distance")
  +	const AxisChar* method = pIWSDZ->GetMethodName();
  +	if (0 == wcscmp(method, L"Distance"))
   		return DistanceWrapped(mc);
  -	else if (method == L"AddPoint")
  +	else if (0 == wcscmp(method, L"AddPoint"))
   		return AddPointWrapped(mc);
  -	else if (method == L"Add")
  +	else if (0 == wcscmp(method, L"Add"))
   		return AddWrapped(mc);
  -	else if (method == L"Perimeter")
  +	else if (0 == wcscmp(method, L"Perimeter"))
   		return PerimeterWrapped(mc);
   	else return FAIL;
   }
  @@ -165,12 +164,11 @@
   
   int CServiceWrapper::SetResponseMethod(IMessageData* mc, const AxisChar* name)
   {
  -	AxisString method = name;
   	IWrapperSoapSerializer* pIWSSZ = NULL;
   	mc->getSoapSerializer(&pIWSSZ);
   	if (!pIWSSZ) return FAIL;
   	ISoapMethod* pMethod = pIWSSZ->createSoapMethod();
  -	pMethod->setLocalName(method + L"Response");
  +	pMethod->setLocalName(name);
   	pMethod->setPrefix(pIWSSZ->getNewNamespacePrefix());
   	pMethod->setUri(L"http://www.opensource.lk/CService");
   	return SUCCESS;
  @@ -184,7 +182,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Distance");
  +	SetResponseMethod(mc, L"DistanceResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Point* v0 = new Point();
  @@ -216,7 +214,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"AddPoint");
  +	SetResponseMethod(mc, L"AddPointResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Point* v0 = new Point();
  @@ -246,7 +244,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Add");
  +	SetResponseMethod(mc, L"AddResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	int v0 = param0->GetInt();
  @@ -272,7 +270,7 @@
   	IWrapperSoapDeSerializer* pIWSDZ = NULL;
   	mc->getSoapDeSerializer(&pIWSDZ);
   	if (!pIWSDZ) return FAIL;
  -	SetResponseMethod(mc, L"Perimeter");
  +	SetResponseMethod(mc, L"PerimeterResponse");
   
   	IParam *param0 = pIWSDZ->GetParam();
   	Triangle* v0 = new Triangle();
  
  
  
  1.2       +8 -9      xml-axis/c/src/server/samples/cservicewrapper/CServiceWrapper.hpp
  
  Index: CServiceWrapper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/cservicewrapper/CServiceWrapper.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CServiceWrapper.hpp	1 Sep 2003 13:36:34 -0000	1.1
  +++ CServiceWrapper.hpp	3 Sep 2003 05:21:25 -0000	1.2
  @@ -1,15 +1,14 @@
   #if !defined __WRAPPER_CLASS_CSERVICEWRAPPER_INCLUDED__
   #define __WRAPPER_CLASS_CSERVICEWRAPPER_INCLUDED__
   
  -#include <WrapperClassHandler.h>
  -#include <IMessageData.h>
  -#include <GDefine.h>
  -#include <IWrapperSoapDeSerializer.h>
  -#include <IWrapperSoapSerializer.h>
  -#include <ISoapMethod.h>
  -#include <IParam.h>
  -#include <string>
  -using namespace std;
  +#include "../cservice/Service.h"
  +#include "../../../common/WrapperClassHandler.h"
  +#include "../../../common/IMessageData.h"
  +#include "../../../common/GDefine.h"
  +#include "../../../common/IWrapperSoapDeSerializer.h"
  +#include "../../../common/IWrapperSoapSerializer.h"
  +#include "../../../common/ISoapMethod.h"
  +#include "../../../common/IParam.h"
   
   class CServiceWrapper : public WrapperClassHandler
   {