axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ros...@apache.org
Subject cvs commit: xml-axis/c/src/server/samples/webservicewrapper WebServiceWrapper.h WebServiceWrapper.cpp
Date Tue, 15 Jul 2003 06:58:39 GMT
roshan      2003/07/14 23:58:39

  Modified:    c/src/server/samples/webservicewrapper WebServiceWrapper.h
                        WebServiceWrapper.cpp
  Log:
  added code
  
  Revision  Changes    Path
  1.2       +9 -9      xml-axis/c/src/server/samples/webservicewrapper/WebServiceWrapper.h
  
  Index: WebServiceWrapper.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/webservicewrapper/WebServiceWrapper.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebServiceWrapper.h	25 Jun 2003 04:55:18 -0000	1.1
  +++ WebServiceWrapper.h	15 Jul 2003 06:58:39 -0000	1.2
  @@ -74,7 +74,7 @@
   
   #include "../webservice/WebService.h"
   #include "../../../common/WrapperClassHandler.h"
  -#include "../../../common/MessageData.h"
  +#include "../../../common/IMessageData.h"
   #include "../../../common/GDefine.h"
   #include "../../../common/AccessBean.h"
   
  @@ -99,17 +99,17 @@
   	webservicewrapper();
   virtual ~webservicewrapper();
   public: //WrapperClassHandler 
  -	int EchoIntArray(MessageData* mc);
  -	int Invoke(MessageData* mc); 
  -	void OnFault(MessageData* pMsg);
  +	int EchoIntArray(IMessageData* mc);
  +	int Invoke(IMessageData* mc); 
  +	void OnFault(IMessageData* pMsg);
   	int Init();
   	int Fini();
   private: //Methods corresponding to the web service methods
  -	int SetResponseMethod(MessageData* mc, const char* name);
  -	int Echo(MessageData* mc);
  -	int Add(MessageData* mc); 
  -	int AddPoint(MessageData *mc);
  -	int EchoPointArray(MessageData *mc);
  +	int SetResponseMethod(IMessageData* mc, const char* name);
  +	int Echo(IMessageData* mc);
  +	int Add(IMessageData* mc); 
  +	int AddPoint(IMessageData *mc);
  +	int EchoPointArray(IMessageData *mc);
   private:
   	WebService *pWs; // Actual web service object.
   
  
  
  
  1.2       +35 -34    xml-axis/c/src/server/samples/webservicewrapper/WebServiceWrapper.cpp
  
  Index: WebServiceWrapper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/samples/webservicewrapper/WebServiceWrapper.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebServiceWrapper.cpp	25 Jun 2003 04:55:18 -0000	1.1
  +++ WebServiceWrapper.cpp	15 Jul 2003 06:58:39 -0000	1.2
  @@ -66,8 +66,8 @@
   //////////////////////////////////////////////////////////////////////
   
   #include "WebServiceWrapper.h"
  -#include "../../../soap/SoapDeSerializer.h"
  -#include "../../../soap/SoapSerializer.h"
  +#include "../../../common/ISoapDeserializer.h"
  +#include "../../../common/ISoapSerializer.h"
   #include "../../../common/BasicTypeSerializer.h"
   //////////////////////////////////////////////////////////////////////
   // Construction/Destruction
  @@ -83,9 +83,9 @@
   	delete pWs;
   }
   // Implementation of WrapperClassHandler interface.
  -int webservicewrapper::Invoke(MessageData* mc)
  +int webservicewrapper::Invoke(IMessageData* mc)
   {
  -	string method = mc->m_pDZ->GetMethodName();
  +	string method = mc->getSoapDeserializer()->GetMethodName();	
   	if ((method == "Echo") || (method == "echo"))
   		return Echo(mc);
   	else if ((method == "Add") || (method == "add"))
  @@ -109,61 +109,62 @@
   	return 0;
   }
   
  -int webservicewrapper::SetResponseMethod(MessageData* mc, const char* name)
  +int webservicewrapper::SetResponseMethod(IMessageData* mc, const char* name)
   {
  -	string method = name;
  -	SoapMethod* pMethod = new SoapMethod();
  +	string method = name;	
  +	ISoapMethod* pMethod= mc->getSoapSerializer()->createSoapMethod();
   	pMethod->setLocalName(method + "Response");
  -	mc->m_pSZ->setSoapMethod(pMethod);
  +	pMethod->setPrefix("m");
  +	pMethod->setUri("http://www.opensource.lk");
   	return SUCCESS;
   }
   // Methods that wraps actual web methods
   
   
  -int webservicewrapper::Echo(MessageData* mc)
  +int webservicewrapper::Echo(IMessageData* mc)
   {
   	SetResponseMethod(mc, "Echo");
  -	Param *param1 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
   	//We know that parameter 1 should be an string
   	string str = param1->GetString();
   	//Call actual web service method with appropriate parameters
   	string strRet = pWs->Echo(str);
   	Param ret(strRet);
   	ret.m_sName = "EchoReturn";
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	return SUCCESS;
   }
   
  -int webservicewrapper::Add(MessageData* mc)
  +int webservicewrapper::Add(IMessageData* mc)
   {
   	SetResponseMethod(mc, "Add");
  -	Param *param1 = mc->m_pDZ->GetParam();
  -	Param *param2 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
  +	Param *param2 = mc->getSoapDeserializer()->GetParam();
   	//Convert parameters to actual types
   	int i1 = param1->GetInt();
   	int i2 = param2->GetInt();
   	//Call actual web service method with appropriate parameters
   	Param ret(pWs->Add(i1, i2));
   	ret.m_sName = "AddReturn";
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	return SUCCESS;	
   }
   
  -void webservicewrapper::OnFault(MessageData* mc)
  +void webservicewrapper::OnFault(IMessageData* mc)
   {
   }
   
  -int webservicewrapper::EchoIntArray(MessageData *mc)
  +int webservicewrapper::EchoIntArray(IMessageData *mc)
   {
   	SetResponseMethod(mc, "EchoIntArray");
  -	Param *param1 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
   	int size = param1->m_Value.a->s;
   	int * arr = new int[size];
   	ArrayBean* Input = new ArrayBean();
   	Input->t = XSD_INT;
   	Input->s = size;
   	Input->v.so = arr;
  -	Input->DeSerialize(mc->m_pDZ);
  +	Input->DeSerialize(mc->getSoapDeserializer());
   	delete Input;
   
   	int retarrsize = 0;
  @@ -183,7 +184,7 @@
   	arrbean->v.so= retarr;
   	ret.m_Value.a = arrbean;
   	ret.m_sName = "EchoIntArrayReturn";	
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	return SUCCESS;	
   
   /*
  @@ -192,7 +193,7 @@
   	Param ret;
   
   	SetResponseMethod(mc, "EchoIntArray");
  -	Param *param1 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
   	//The wrapper generator knows the parameter passed to the
   	//webservice method is an int array
   	int size = param1->m_Value.a->s;
  @@ -200,7 +201,7 @@
   	int * arr = new int[size];
   	for(int i=0;i<size;i++)
   	{
  -		arr[i] = mc->m_pDZ->GetParam()->GetInt();
  +		arr[i] = mc->getSoapDeserializer()->GetParam()->GetInt();
   	}
   
   	retarr = pWs->EchoIntArray(size,arr,&retarrsize);
  @@ -215,41 +216,41 @@
   	arrbean->v.so= retarr;
   	ret.m_Value.a = arrbean;
   	ret.m_sName = "EchoIntArrayReturn";	
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	return SUCCESS;	
   */
   }
   
  -int webservicewrapper::AddPoint(MessageData *mc)
  +int webservicewrapper::AddPoint(IMessageData *mc)
   {
   	SetResponseMethod(mc, "AddPoint");
   
  -	Param *param1 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
   	Point* p1 = new Point();
   	param1->m_Value.o = p1;
   	param1->m_Type = USER_TYPE;
  -	mc->m_pDZ->Deserialize(param1,0);
  +	mc->getSoapDeserializer()->Deserialize(param1,0);
   	
  -	Param *param2 = mc->m_pDZ->GetParam();
  +	Param *param2 = mc->getSoapDeserializer()->GetParam();
   	Point* p2 = new Point();
   	param2->m_Value.o = p2;
   	param2->m_Type = USER_TYPE;
  -	mc->m_pDZ->Deserialize(param2,0);
  +	mc->getSoapDeserializer()->Deserialize(param2,0);
   	
   	Point* pRet = pWs->AddPoint(p1, p2);
   
   	Param ret;
   	ret.m_Type = USER_TYPE;
   	ret.m_Value.o = pRet;
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	ret.m_Value.o = NULL;
   	return SUCCESS;
   }
   
  -int webservicewrapper::EchoPointArray(MessageData *mc)
  +int webservicewrapper::EchoPointArray(IMessageData *mc)
   {
   	SetResponseMethod(mc, "EchoPointArray");
  -	Param *param1 = mc->m_pDZ->GetParam();
  +	Param *param1 = mc->getSoapDeserializer()->GetParam();
   	int size = param1->m_Value.a->s;
   	Point* arr = new Point[size];
   	AccessBean** pArr = new AccessBean*[size]; 
  @@ -259,7 +260,7 @@
   	}
   	param1->m_Value.a->t = USER_TYPE;
   	param1->m_Value.a->v.co = pArr;
  -	mc->m_pDZ->Deserialize(param1,0);
  +	mc->getSoapDeserializer()->Deserialize(param1,0);
   
   	Point* pRet = pWs->EchoPointArray(size, arr,&size);
   
  @@ -281,12 +282,12 @@
   	ret.m_Type = XSD_ARRAY;
   	ret.m_Value.a = arrbean;
   	ret.m_sName = "EchoIntArrayReturn";	
  -	mc->m_pSZ->setResponseParam(ret);
  +	mc->getSoapSerializer()->setResponseParam(ret);
   	ret.m_Value.a = NULL;
   	return SUCCESS;	
   }
   
  -int Point::DeSerialize(SoapDeSerializer *pDZ)
  +int Point::DeSerialize(ISoapDeSerializer *pDZ)
   {
   	x = pDZ->GetParam()->GetInt();
   	y = pDZ->GetParam()->GetInt();
  
  
  

Mime
View raw message