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/07/21 16:21:11 UTC

cvs commit: xml-axis/c/src/soap XMLStreamHandler.h XMLStreamHandler.cpp TypeMapping.h SoapSerializer.h SoapSerializer.cpp SoapMethod.cpp SoapDeSerializer.h SoapDeSerializer.cpp BasicNode.h Attribute.h Attribute.cpp

susantha    2003/07/21 07:21:10

  Modified:    c/src/soap XMLStreamHandler.h XMLStreamHandler.cpp
                        TypeMapping.h SoapSerializer.h SoapSerializer.cpp
                        SoapMethod.cpp SoapDeSerializer.h
                        SoapDeSerializer.cpp BasicNode.h Attribute.h
                        Attribute.cpp
  Log:
  Introduced Interfaces to AccessBean, ArrayBean and Param classes for
  1. Making wrapper class API simple
  2. Avoid code duplication in Webservice DLLs (Web service DLLs having its own copy of linked code)
  
  Revision  Changes    Path
  1.2       +2 -0      xml-axis/c/src/soap/XMLStreamHandler.h
  
  Index: XMLStreamHandler.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/XMLStreamHandler.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLStreamHandler.h	25 Jun 2003 07:31:35 -0000	1.1
  +++ XMLStreamHandler.h	21 Jul 2003 14:21:09 -0000	1.2
  @@ -74,6 +74,7 @@
   
   #include "../common/Param.h"
   #include "../common/AccessBean.h"
  +#include "../common/ArrayBean.h"
   #include "SoapEnvelope.h"
   #include "SoapHeader.h"
   #include "SoapMethod.h"
  @@ -115,6 +116,7 @@
   	int Success();
   	Param m_Param; //Param to which each parameter data is extracted
   	ArrayBean m_ArrayBean;
  +	AccessBean m_AccessBean;
   	int m_Success;
   	SOAP_PARSE_LEVEL m_PL0;
   	SOAP_PARSE_LEVEL m_PL1;
  
  
  
  1.3       +9 -8      xml-axis/c/src/soap/XMLStreamHandler.cpp
  
  Index: XMLStreamHandler.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/XMLStreamHandler.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLStreamHandler.cpp	16 Jul 2003 14:21:08 -0000	1.2
  +++ XMLStreamHandler.cpp	21 Jul 2003 14:21:09 -0000	1.3
  @@ -323,9 +323,9 @@
   						{
   							//custom data type
   							m_Param.m_Type = USER_TYPE;
  -							m_Param.m_Value.o = &m_ArrayBean; //ArrayBean can be used as an AccessBean;
  -							m_Param.m_Value.o->m_TypeName = sType;
  -							m_Param.m_Value.o->m_URI = m_NsStack[sPrefix];
  +							m_Param.m_Value.pBean = &m_AccessBean; //ArrayBean can be used as an AccessBean;
  +							m_Param.m_Value.pBean->m_TypeName = sType;
  +							m_Param.m_Value.pBean->m_URI = m_NsStack[sPrefix];
   						}
   					}
   					else
  @@ -347,7 +347,7 @@
   			if (local == "arrayType")
   			{
   				m_Param.m_Type = XSD_ARRAY;
  -				m_Param.m_Value.a = &m_ArrayBean;
  +				m_Param.m_Value.pArray = &m_ArrayBean;
   
   				int colonindex = value.find(':'); 
   				if (colonindex != string::npos) 
  @@ -366,12 +366,13 @@
   						if(URIMapping::Map(m_NsStack[sPrefix]) == URI_XSD)
   						{
   							//check for xml data types
  -							m_Param.m_Value.a->m_type = TypeMapping::Map(sType);
  +							m_Param.m_Value.pArray->m_type = TypeMapping::Map(sType);
   						}
   						else
   						{
  -							m_Param.m_Value.a->m_TypeName = sType;
  -							m_Param.m_Value.a->m_URI = m_NsStack[sPrefix];
  +							m_Param.m_Value.pArray->m_TypeName = sType;
  +							m_Param.m_Value.pArray->m_URI = m_NsStack[sPrefix];
  +							m_Param.m_Value.pArray->m_type = USER_TYPE;
   							//array of custom data types
   						}
   						if(SUCCESS != SetArrayDimensions(sDimensions))
  @@ -421,7 +422,7 @@
   	{
   		si = sDimensions.find('[',ei);
   		ei = sDimensions.find(']',si);
  -		m_Param.m_Value.a->m_size.push_back(atoi((sDimensions.substr(si+1,ei)).c_str()));
  +		m_Param.m_Value.pArray->m_size.push_back(atoi((sDimensions.substr(si+1,ei)).c_str()));
   	} while (sDimensions.find('[',ei) != string::npos);
   	return SUCCESS;
   }
  
  
  
  1.3       +1 -1      xml-axis/c/src/soap/TypeMapping.h
  
  Index: TypeMapping.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/TypeMapping.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TypeMapping.h	1 Jul 2003 04:17:13 -0000	1.2
  +++ TypeMapping.h	21 Jul 2003 14:21:09 -0000	1.3
  @@ -77,7 +77,7 @@
   
   using namespace std;
   
  -enum XSDTYPE { XSD_UNKNOWN, XSD_INT, XSD_FLOAT, XSD_STRING, XSD_LONG, XSD_SHORT, XSD_BYTE, XSD_UNSIGNEDLONG, \
  +enum XSDTYPE { XSD_UNKNOWN=1, XSD_INT, XSD_FLOAT, XSD_STRING, XSD_LONG, XSD_SHORT, XSD_BYTE, XSD_UNSIGNEDLONG, \
   				XSD_BOOLEAN, XSD_UNSIGNEDINT, XSD_UNSIGNEDSHORT, XSD_UNSIGNEDBYTE, \
   				XSD_DOUBLE, XSD_DECIMAL, XSD_DURATION, XSD_DATETIME, XSD_TIME, XSD_DATE, \
   				XSD_YEARMONTH, XSD_YEAR, XSD_MONTHDAY, XSD_DAY, XSD_MONTH, XSD_HEXBINARY, \
  
  
  
  1.5       +2 -1      xml-axis/c/src/soap/SoapSerializer.h
  
  Index: SoapSerializer.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SoapSerializer.h	16 Jul 2003 14:21:08 -0000	1.4
  +++ SoapSerializer.h	21 Jul 2003 14:21:09 -0000	1.5
  @@ -105,7 +105,8 @@
   	int setSoapEnvelope(SoapEnvelope* pSoapEnvelope);
   	SoapSerializer();
   	virtual ~SoapSerializer();
  -	int setResponseParam(Param* param);
  +	IParam* setResponseParam(XSDTYPE nType, uParamValue Value);
  +	IArrayBean* makeArrayBean(XSDTYPE nType, void* pArray);
   };
   
   #endif // !defined(AFX_SOAPSERIALIZER_H__C37229AD_BD54_430D_9619_E4574CF95334__INCLUDED_)
  
  
  
  1.6       +14 -9     xml-axis/c/src/soap/SoapSerializer.cpp
  
  Index: SoapSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SoapSerializer.cpp	16 Jul 2003 14:21:08 -0000	1.5
  +++ SoapSerializer.cpp	21 Jul 2003 14:21:09 -0000	1.6
  @@ -68,6 +68,7 @@
   #include "SoapEnvelope.h"
   #include "SoapSerializer.h"
   #include "../common/GDefine.h"
  +#include "../common/ArrayBean.h"
   
   extern "C" int sendSoapResponse(char *cSerializedStream);
   
  @@ -130,16 +131,17 @@
   	return intStatus;
   }
   
  -int SoapSerializer::setResponseParam(Param *param)
  +IParam* SoapSerializer::setResponseParam(XSDTYPE nType, uParamValue Value)
   {
  -	int intStatus= FAIL;
  +	Param* pParam = new Param();
  +	pParam->SetValue(nType, Value);
   
  -	if(m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody) && (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) {
  -		m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->setOutputParam(param);
  -		intStatus= SUCCESS;
  +	if(m_pSoapEnvelope && (m_pSoapEnvelope->m_pSoapBody) && (m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
  +	{
  +		m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->setOutputParam(pParam);
   	}
   
  -	return intStatus;
  +	return pParam;
   }
   
   int SoapSerializer::setSoapFault(SoapFault *pSoapFault)
  @@ -246,7 +248,10 @@
   	return pMethod;
   }
   
  -/*SoapMethodBase* SoapSerializer::createSoapMethodInstance()
  +IArrayBean* SoapSerializer::makeArrayBean(XSDTYPE nType, void* pArray)
   {
  -
  -}*/
  +	ArrayBean* pAb = new ArrayBean();
  +	pAb->m_type = nType;
  +	pAb->m_value.sta = pArray;
  +	return pAb;
  +}
  \ No newline at end of file
  
  
  
  1.6       +2 -2      xml-axis/c/src/soap/SoapMethod.cpp
  
  Index: SoapMethod.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapMethod.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SoapMethod.cpp	16 Jul 2003 14:21:08 -0000	1.5
  +++ SoapMethod.cpp	21 Jul 2003 14:21:09 -0000	1.6
  @@ -75,7 +75,7 @@
   
   SoapMethod::SoapMethod()
   {
  -	m_pOutputParam= new Param();
  +	m_pOutputParam = NULL;
   }
   
   SoapMethod::~SoapMethod()
  @@ -114,7 +114,7 @@
   {
   	if (param)
   	{
  -		*m_pOutputParam = *param;
  +		m_pOutputParam = param;
   	}
   }
   
  
  
  
  1.4       +2 -2      xml-axis/c/src/soap/SoapDeSerializer.h
  
  Index: SoapDeSerializer.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapDeSerializer.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SoapDeSerializer.h	16 Jul 2003 14:21:08 -0000	1.3
  +++ SoapDeSerializer.h	21 Jul 2003 14:21:09 -0000	1.4
  @@ -89,8 +89,8 @@
   	int GetVersion();
   	string& GetMethodName();
   	void Init();
  -	Param* GetParam();
  -	int Deserialize(Param* pParam, int bHref);
  +	IParam* GetParam();
  +	int Deserialize(IParam* pIParam, int bHref);
   	SoapFault* GetFault();
   	SoapMethod* GetMethod();
   	SoapBody* GetBody();
  
  
  
  1.3       +7 -6      xml-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SoapDeSerializer.cpp	16 Jul 2003 14:21:08 -0000	1.2
  +++ SoapDeSerializer.cpp	21 Jul 2003 14:21:09 -0000	1.3
  @@ -123,24 +123,25 @@
   }
   
   //this function is more usefull with XMLpull parser
  -int SoapDeSerializer::Deserialize(Param* pParam, int bHref)
  +int SoapDeSerializer::Deserialize(IParam* pIParam, int bHref)
   {
  +	Param* pParam = (Param*)pIParam;
   	//if multiref add to m_Multirefs map
   	//else call its deserializer
   	switch (pParam->m_Type)
   	{
   	case XSD_ARRAY:
  -		if (pParam->m_Value.a && pParam->m_Value.a->m_value.sta)
  +		if (pParam->m_Value.pArray && pParam->m_Value.pArray->m_value.sta)
   		{
  -			pParam->m_Value.a->DeSerialize(this);
  +			pParam->m_Value.pArray->DeSerialize(this);
   		}
   		else
   			return FAIL;
   		break;
   	case USER_TYPE:
  -		if (pParam->m_Value.o)
  +		if (pParam->m_Value.pBean)
   		{
  -			pParam->m_Value.o->DeSerialize(this);
  +			pParam->m_Value.pBean->DeSerialize(this);
   		}
   		else
   			return FAIL;
  @@ -150,7 +151,7 @@
   	return SUCCESS;
   }
   
  -Param* SoapDeSerializer::GetParam()
  +IParam* SoapDeSerializer::GetParam()
   {
   	return m_pHandler->GetParam();
   }
  
  
  
  1.3       +1 -2      xml-axis/c/src/soap/BasicNode.h
  
  Index: BasicNode.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/BasicNode.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicNode.h	15 Jul 2003 07:09:01 -0000	1.2
  +++ BasicNode.h	21 Jul 2003 14:21:09 -0000	1.3
  @@ -73,10 +73,9 @@
   #endif // _MSC_VER > 1000
   
   #include <string>
  +using namespace std;
   
   class SoapSerializer;
  -
  -using namespace std;
   
   enum NODE_TYPE { ELEMENT_NODE=1, CHARACTER_NODE};
   
  
  
  
  1.4       +1 -2      xml-axis/c/src/soap/Attribute.h
  
  Index: Attribute.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/Attribute.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Attribute.h	15 Jul 2003 07:50:53 -0000	1.3
  +++ Attribute.h	21 Jul 2003 14:21:09 -0000	1.4
  @@ -73,10 +73,9 @@
   #endif // _MSC_VER > 1000
   
   #include <string>
  +using namespace std;
   
   class SoapSerializer;
  -
  -using namespace std;
   
   class Attribute  
   {
  
  
  
  1.4       +0 -1      xml-axis/c/src/soap/Attribute.cpp
  
  Index: Attribute.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/Attribute.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Attribute.cpp	15 Jul 2003 07:50:53 -0000	1.3
  +++ Attribute.cpp	21 Jul 2003 14:21:09 -0000	1.4
  @@ -68,7 +68,6 @@
   #include "Attribute.h"
   #include "../common/GDefine.h"
   #include "../soap/SoapSerializer.h"
  -#include <iostream>
   
   //////////////////////////////////////////////////////////////////////
   // Construction/Destruction