axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: xml-axis/c/src/wsdd WSDDDocument.cpp WSDDDocument.h WSDDKeywords.cpp
Date Thu, 11 Sep 2003 12:24:47 GMT
susantha    2003/09/11 05:24:47

  Modified:    c/src/common AxisUtils.cpp AxisUtils.h GDefine.h
               c/src/soap XMLStreamHandler.cpp XMLStreamHandler.h
               c/src/wsdd WSDDDocument.cpp WSDDDocument.h WSDDKeywords.cpp
  Log:
  Code base completely reverted to using "char" for AxisChar instead of "unsigned short" which
gave trouble in compiling and running Axis C++ on Linux
  
  Revision  Changes    Path
  1.5       +7 -5      xml-axis/c/src/common/AxisUtils.cpp
  
  Index: AxisUtils.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/AxisUtils.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AxisUtils.cpp	9 Sep 2003 12:53:00 -0000	1.4
  +++ AxisUtils.cpp	11 Sep 2003 12:24:47 -0000	1.5
  @@ -89,9 +89,10 @@
   
   }
   
  -AxisXMLCh* AxisUtils::ToAxisXMLCh(const AxisChar* pch)
  +const AxisXMLCh* AxisUtils::ToAxisXMLCh(const AxisChar* pch)
   {
  -	return XMLString::transcode(pch); //this is ok as long as we use xerces library.
  +//	return XMLString::transcode(pch); //this is ok as long as we use xerces library.
  +	return pch;
   }
   
   void AxisUtils::Initialize()
  @@ -106,8 +107,9 @@
   //for initialization purposes.
   const AxisXMLCh* AxisUtils::Convert(const AxisChar* pch)
   {
  -	if (XMLString::transcode(pch, m_Buffer, CONVERT_BUFFER_SIZE))
  -		return m_Buffer;
  -	return NULL;
  +//	if (XMLString::transcode(pch, m_Buffer, CONVERT_BUFFER_SIZE))
  +//		return m_Buffer;
  +//	return NULL;
  +	return pch;
   }
   
  
  
  
  1.5       +1 -1      xml-axis/c/src/common/AxisUtils.h
  
  Index: AxisUtils.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/AxisUtils.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AxisUtils.h	9 Sep 2003 12:53:00 -0000	1.4
  +++ AxisUtils.h	11 Sep 2003 12:24:47 -0000	1.5
  @@ -78,7 +78,7 @@
   	friend class URIMapping;
   public:
   	static void Initialize();
  -	static AxisXMLCh* ToAxisXMLCh(const AxisChar* pch);
  +	static const AxisXMLCh* ToAxisXMLCh(const AxisChar* pch);
   	AxisUtils();
   	virtual ~AxisUtils();
   	// any usefull static const AxisXMLCh strings. 
  
  
  
  1.8       +2 -1      xml-axis/c/src/common/GDefine.h
  
  Index: GDefine.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/GDefine.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GDefine.h	5 Sep 2003 10:48:50 -0000	1.7
  +++ GDefine.h	11 Sep 2003 12:24:47 -0000	1.8
  @@ -62,6 +62,7 @@
    */
   
   #pragma warning (disable : 4786)
  +#pragma warning (disable : 4530)
   
   #if !defined(__GDEFINE_INCLUDED__)
   #define __GDEFINE_INCLUDED__
  @@ -75,7 +76,7 @@
   #define AxisChar char //Charactor used in Axis
   #define AxisString basic_string<char> //String used in Axis
   
  -#define AxisXMLCh	unsigned short //Xerces uses 16 bit char always.
  +#define AxisXMLCh char //Xerces uses 16 bit char always.
   #define AxisXMLString basic_string<AxisXMLCh>
   
   #ifdef WIN32
  
  
  
  1.13      +44 -38    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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XMLStreamHandler.cpp	9 Sep 2003 12:53:01 -0000	1.12
  +++ XMLStreamHandler.cpp	11 Sep 2003 12:24:47 -0000	1.13
  @@ -69,8 +69,6 @@
   #include "CharacterElement.h"
   #include "../common/AxisUtils.h"
   
  -#define __XTRC(X) (true == XMLString::transcode(X, m_Buffer, TRANSCODE_BUFFER_SIZE-1))?
m_Buffer : "" 
  -
   XMLStreamHandler::XMLStreamHandler()
   {
   	m_pEnv = NULL;
  @@ -113,7 +111,7 @@
   	switch (m_PL0)
   	{
   	case SOAP_UNKNOWN:
  -	if(XMLString::equals(localname,SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ENVELOPE]))
  +	if(XMLString::equals(__XTRC(localname),SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ENVELOPE]))
   	{
   		m_PL0 = SOAP_ENVELOP;
   		m_pEnv = new SoapEnvelope();
  @@ -122,21 +120,21 @@
   	}
   	break;
   	case SOAP_ENVELOP:
  -	if(XMLString::equals(localname,SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_BODY]))
  +	if(XMLString::equals(__XTRC(localname),SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_BODY]))
   	{
   		m_PL0 = SOAP_BODY;
   		m_pBody = new SoapBody();
   		//set all attributes of SoapBody
   		FillBody(uri,localname,qname,attrs);	
   	}
  -	else if (XMLString::equals(localname,SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_HEADER]))
  +	else if (XMLString::equals(__XTRC(localname),SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_HEADER]))
   	{
   		m_PL0 = SOAP_HEADER;
   		m_pHead = new SoapHeader();
   		//set all attributes of SoapHeader
   		FillHeader(uri,localname,qname,attrs);
   	}
  -	else if (XMLString::equals(localname,SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_FAULT]))
  +	else if (XMLString::equals(__XTRC(localname),SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_FAULT]))
   	{
   		//m_PL0 = SOAP_FAULT;
   		//m_pFault = SoapFault::getSoapFault(1);
  @@ -159,9 +157,9 @@
   		switch (m_PL1)
   		{
   		case SOAP_UNKNOWN:
  -			if (XMLString::equals(localname,SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_MULTIREF]))
  +			if (XMLString::equals(__XTRC(localname),SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_MULTIREF]))
   			{
  -				m_sLastElement = localname;
  +				m_sLastElement = __XTRC(localname);
   				SetParamType(attrs); 
   				m_PL1 = SOAP_PARAM;
   			}
  @@ -175,18 +173,18 @@
   		case SOAP_METHOD: //now comes parameters
   			//Get Param name and type
   			//m_Param.m_sName = localname;
  -			m_sLastElement = localname;
  +			m_sLastElement = __XTRC(localname);
   			SetParamType(attrs); 
   			m_PL1 = SOAP_PARAM;
   			m_nParamNestingLevel++;
   			break;
   		case SOAP_PARAM: //Custom types
  -			if (!(m_sLastElement == localname))
  +			if (m_sLastElement != (const char*)__XTRC(localname))
   			{
   				m_Params.push_back(new Param(m_Param)); //parent param
   			}
   			//m_Param.m_sName = localname;
  -			m_sLastElement = localname;
  +			m_sLastElement = __XTRC(localname);
   			SetParamType(attrs); 
   			m_nParamNestingLevel++;
   			break;
  @@ -215,7 +213,7 @@
   		break;
   	case SOAP_PARAM: //end of a parameter
   		//Add parameter to list
  -		if (m_sLastElement == localname)
  +		if (m_sLastElement == __XTRC(localname))
   		{
   			m_Params.push_back(new Param(m_Param)); //current param
   		}
  @@ -284,12 +282,12 @@
   
   void XMLStreamHandler::startPrefixMapping(const XMLCh* const prefix, const XMLCh* const
uri)
   {
  -	m_NsStack[prefix] = uri; //I think the same prifix cannot repeat ???
  +	m_NsStack[__XTRC(prefix)] = __XTRC(uri); //I think the same prifix cannot repeat ???
   }
   
   void XMLStreamHandler::endPrefixMapping(const XMLCh* const prefix)
   {
  -	m_NsStack.erase(prefix); //I think the same prifix cannot repeat ???
  +	m_NsStack.erase(__XTRC(prefix)); //I think the same prifix cannot repeat ???
   }
   
   void XMLStreamHandler::warning(const SAXParseException& exception)
  @@ -319,14 +317,14 @@
   	AxisXMLString sValue, sPrefix, sType, sDimensions;
   	for (int i = 0; i < attrs.getLength(); i++) 
   	{
  -		const AxisXMLCh* URI = attrs.getURI(i); 
  -		const AxisXMLCh* local = attrs.getLocalName(i);
  -		sValue = attrs.getValue(i);
  -		URITYPE urit = URIMapping::Map(URI);
  +		AxisXMLString URI = __XTRC(attrs.getURI(i)); 
  +		AxisXMLString local = __XTRC(attrs.getLocalName(i));
  +		sValue = __XTRC(attrs.getValue(i));
  +		URITYPE urit = URIMapping::Map(URI.c_str());
   		switch (urit)
   		{
   		case URI_XSI: //xsi:type="xsd:int"
  -			if (XMLString::equals(local, SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_TYPE]))
  +			if (XMLString::equals(local.c_str(), SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_TYPE]))
   			{
   				int colonindex = sValue.find(AxisUtils::m_strColon); 
   				if (colonindex != AxisXMLString::npos) 
  @@ -345,8 +343,8 @@
   							//custom data type
   							m_Param.m_Type = USER_TYPE;
   							m_Param.m_Value.pCplxObj = &m_CplxObj; //ArrayBean can be used as an AccessBean;
  -							m_Param.m_Value.pCplxObj->m_TypeName = __XTRC(sType.c_str());
  -							m_Param.m_Value.pCplxObj->m_URI = __XTRC(m_NsStack[sPrefix].c_str());
  +							m_Param.m_Value.pCplxObj->m_TypeName = sType.c_str();
  +							m_Param.m_Value.pCplxObj->m_URI = m_NsStack[sPrefix].c_str();
   						}
   					}
   					else
  @@ -365,7 +363,7 @@
   			}
   			break;
   		case URI_ENC: //enc:arrayType="xs:string[6]"
  -			if (XMLString::equals(local, SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ARRAYTYPE]))
  +			if (XMLString::equals(local.c_str(), SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ARRAYTYPE]))
   			{
   				m_Param.m_Type = XSD_ARRAY;
   				m_Param.m_Value.pArray = &m_ArrayBean;
  @@ -391,8 +389,8 @@
   						}
   						else
   						{
  -							m_Param.m_Value.pArray->m_TypeName = __XTRC(sType.c_str());
  -							m_Param.m_Value.pArray->m_URI = __XTRC(m_NsStack[sPrefix].c_str());
  +							m_Param.m_Value.pArray->m_TypeName = sType.c_str();
  +							m_Param.m_Value.pArray->m_URI = m_NsStack[sPrefix].c_str();
   							m_Param.m_Value.pArray->m_type = USER_TYPE;
   							//array of custom data types
   						}
  @@ -418,12 +416,12 @@
   			break;
   		case URI_UNKNOWN:
   			//check for accessors for multiref values
  -			if (XMLString::equals(local, SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_HREF]))
  +			if (XMLString::equals(local.c_str(), SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_HREF]))
   			{
   				m_Param.m_Type = ACCESSOR;
   				//m_Param.m_sValue = sValue.substr(sValue.find('#')+1);
   			}
  -			else if (XMLString::equals(local, SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ID]))
  +			else if (XMLString::equals(local.c_str(), SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_ID]))
   			{
   				//m_Param.m_sName = sValue;
   			}
  @@ -443,7 +441,7 @@
   	{
   		si = sDimensions.find(AxisUtils::m_strLeftSqBracket, ei);
   		ei = sDimensions.find(AxisUtils::m_strLeftSqBracket, si);
  -		m_Param.m_Value.pArray->m_size.push_back(XMLString::parseInt(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(AxisUtils::m_strLeftSqBracket, ei) != string::npos);
   	return SUCCESS;
   }
  @@ -500,22 +498,22 @@
   {
   	AxisXMLString str;
   	Attribute* pAttr;
  -	str = qname;
  +	str = __XTRC(qname);
   	pAttr = new Attribute();
   	if (str.find(AxisUtils::m_strColon) != AxisXMLString::npos) 
   	{
   		str = str.substr(0, str.find(AxisUtils::m_strColon));
  -		m_pEnv->setPrefix(__XTRC(str.c_str()));
  -		pAttr->setPrefix(__XTRC(str.c_str()));
  +		m_pEnv->setPrefix(str.c_str());
  +		pAttr->setPrefix(str.c_str());
   	}
   	pAttr->setValue(__XTRC(uri));
   	m_pEnv->addNamespaceDecl(pAttr);
   
  -	if (XMLString::equals(uri, SoapKeywordMapping::Map(SOAP_VER_1_1).pchNamespaceUri))
  +	if (XMLString::equals(__XTRC(uri), SoapKeywordMapping::Map(SOAP_VER_1_1).pchNamespaceUri))
   	{
   		m_nSoapVersion = SOAP_VER_1_1;
   	}
  -	else if (XMLString::equals(uri, SoapKeywordMapping::Map(SOAP_VER_1_2).pchNamespaceUri))
  +	else if (XMLString::equals(__XTRC(uri), SoapKeywordMapping::Map(SOAP_VER_1_2).pchNamespaceUri))
   	{
   		m_nSoapVersion = SOAP_VER_1_2;
   	}
  @@ -554,13 +552,13 @@
   
   void XMLStreamHandler::FillMethod(const XMLCh *const uri, const XMLCh *const localname,
const XMLCh *const qname, const Attributes &attrs)
   {
  -	AxisXMLString str = qname;
  +	AxisXMLString str = __XTRC(qname);
   	if (str.find(AxisUtils::m_strColon) != AxisXMLString::npos) 
   	{
   		str = str.substr(0, str.find(AxisUtils::m_strColon));
  -		m_pMethod->setPrefix(__XTRC(str.c_str()));
  -		str = uri;
  -		m_pMethod->setUri(__XTRC(str.c_str()));
  +		m_pMethod->setPrefix(str.c_str());
  +		str = __XTRC(uri);
  +		m_pMethod->setUri(str.c_str());
   	}
   	m_pMethod->setLocalName(__XTRC(localname));
   }
  @@ -568,12 +566,20 @@
   void XMLStreamHandler::createHeaderBlock(const XMLCh *const uri, const XMLCh *const localname,
const XMLCh *const qname, const Attributes &attrs)
   {
   	m_pHeaderBlock= new HeaderBlock();
  -	AxisXMLString str = qname;	
  +	AxisXMLString str = __XTRC(qname);	
   	if (str.find(AxisUtils::m_strColon) != AxisXMLString::npos) 
   	{
   		str = str.substr(0, str.find(AxisUtils::m_strColon));
  -		m_pHeaderBlock->setPrefix(__XTRC(str.c_str()));		
  +		m_pHeaderBlock->setPrefix(str.c_str());		
   	}
   	m_pHeaderBlock->setLocalName(__XTRC(localname));
   	m_pHeaderBlock->setUri(__XTRC(uri));
  +}
  +
  +const AxisChar* XMLStreamHandler::__XTRC(const XMLCh *pChar)
  +{
  +	if (true == (XMLString::transcode(pChar, m_Buffer, TRANSCODE_BUFFER_SIZE-1)))
  +		return m_Buffer;
  +	else 
  +		return ""; 
   }
  
  
  
  1.7       +1 -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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XMLStreamHandler.h	5 Sep 2003 10:48:51 -0000	1.6
  +++ XMLStreamHandler.h	11 Sep 2003 12:24:47 -0000	1.7
  @@ -126,6 +126,7 @@
   	AxisXMLString m_sLastElement;
   	HeaderBlock* m_pHeaderBlock;
   private:
  +	const AxisChar* __XTRC(const XMLCh* pChar);
   	void createHeaderBlock(const XMLCh *const uri,const XMLCh *const localname,const XMLCh
*const qname,const Attributes &attrs);
   	int m_nParamNestingLevel;
   	int SetArrayDimensions(AxisXMLString& sDimensions);
  
  
  
  1.15      +76 -70    xml-axis/c/src/wsdd/WSDDDocument.cpp
  
  Index: WSDDDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDDocument.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WSDDDocument.cpp	9 Sep 2003 12:53:01 -0000	1.14
  +++ WSDDDocument.cpp	11 Sep 2003 12:24:47 -0000	1.15
  @@ -67,8 +67,6 @@
   #include <string>
   //#include "../common/AxisTrace.h"
   
  -#define __XTRC(X) (true == XMLString::transcode(X, m_Buffer, TRANSCODE_BUFFER_SIZE-1))?
m_Buffer : ""
  -
   WSDDDocument::WSDDDocument()
   {
   	m_lev0 = WSDD_UNKNOWN;
  @@ -113,7 +111,7 @@
   
   void  WSDDDocument::endElement (const XMLCh *const uri, const XMLCh *const localname, const
XMLCh *const qname)
   {
  -	if (!XMLString::equals(localname, kw_param)) //just neglect endElement of parameter
  +	if (!XMLString::equals(__XTRC(localname), kw_param)) //just neglect endElement of parameter
   	{
   		if (m_lev1 == WSDD_UNKNOWN) //not inside a requestFlow or responseFlow elements
   		{
  @@ -126,7 +124,7 @@
   				m_lev0 = WSDD_DEPLOYMENT;
   				break;
   			case WSDD_SERVICE:
  -				if (XMLString::equals(localname, kw_srv))
  +				if (XMLString::equals(__XTRC(localname), kw_srv))
   				{
   					//add service object to Deployment object
   					m_pDeployment->AddService(m_pService);
  @@ -153,7 +151,7 @@
   		}
   		else // inside a requestFlow or responseFlow elements
   		{
  -			if(XMLString::equals(localname, kw_hdl))
  +			if(XMLString::equals(__XTRC(localname), kw_hdl))
   			{
   				m_lev2 = WSDD_UNKNOWN;
   				//add handler in m_pHandler to the corresponding container.
  @@ -180,11 +178,11 @@
   					default: ; //this cannot happen ?? 
   				}
   			}
  -			else if(XMLString::equals(localname, kw_rqf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rqf))
   			{  
   				m_lev1 = WSDD_UNKNOWN;
   			}
  -			else if(XMLString::equals(localname, kw_rsf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rsf))
   			{  
   				m_lev1 = WSDD_UNKNOWN;
   			}						
  @@ -196,18 +194,18 @@
   {
   	for (int i = 0; i < attrs.getLength(); i++) 
   	{
  -		const AxisXMLCh* local = attrs.getLocalName(i);
  -		const AxisXMLCh* value = attrs.getValue(i);
  +		AxisXMLString local = __XTRC(attrs.getLocalName(i));
  +		AxisXMLString value = __XTRC(attrs.getValue(i));
   		switch(ElementType)
   		{
   		case WSDD_SERVICE: //add this attribute to current service object
  -			if (XMLString::equals(local, kw_name))
  +			if (XMLString::equals(local.c_str(), kw_name))
   			{
  -				m_pService->SetServiceName(__XTRC(value));
  +				m_pService->SetServiceName(value.c_str());
   			}
  -			else if (XMLString::equals(local, kw_prv))
  +			else if (XMLString::equals(local.c_str(), kw_prv))
   			{
  -				m_pService->SetProvider(__XTRC(value));
  +				m_pService->SetProvider(value.c_str());
   			}
   			else
   			{
  @@ -215,22 +213,22 @@
   			}
   			break;
   		case WSDD_HANDLER: //add this attribute to current handler object
  -			if (XMLString::equals(local, kw_name))
  +			if (XMLString::equals(local.c_str(), kw_name))
   			{
   				//usefull ? ignore for now .. //TODO
   			}
  -			else if (XMLString::equals(local, kw_type))
  +			else if (XMLString::equals(local.c_str(), kw_type))
   			{
   				//we get the libname for the hanlder here ???
  -				m_pHandler->SetLibName(__XTRC(value));
  -				if (m_pLibNameIdMap->find(__XTRC(value)) != m_pLibNameIdMap->end()) //libray
name already in the map
  +				m_pHandler->SetLibName(value.c_str());
  +				if (m_pLibNameIdMap->find(value.c_str()) != m_pLibNameIdMap->end()) //libray
name already in the map
   				{
  -					m_pHandler->SetLibId((*m_pLibNameIdMap)[__XTRC(value)]);
  +					m_pHandler->SetLibId((*m_pLibNameIdMap)[value.c_str()]);
   				}
   				else
   				{
  -					(*m_pLibNameIdMap)[__XTRC(value)] = ++m_nLibId;
  -					m_pHandler->SetLibId((*m_pLibNameIdMap)[__XTRC(value)]);
  +					(*m_pLibNameIdMap)[value.c_str()] = ++m_nLibId;
  +					m_pHandler->SetLibId((*m_pLibNameIdMap)[value.c_str()]);
   				}
   			}
   			else
  @@ -240,7 +238,7 @@
   			break;
   		case WSDD_REQFLOW:
   		case WSDD_RESFLOW:
  -			if (XMLString::equals(local, kw_name))
  +			if (XMLString::equals(local.c_str(), kw_name))
   			{
   				//usefull ? ignore for now .. //TODO
   			}
  @@ -250,12 +248,12 @@
   			}
   			break;
   		case WSDD_TRANSPORT:
  -			if (XMLString::equals(local, kw_name))
  +			if (XMLString::equals(local.c_str(), kw_name))
   			{
   				//get tranport type
  -				if (XMLString::equals(value, kw_http))
  +				if (XMLString::equals(value.c_str(), kw_http))
   					m_CurTrType = APTHTTP;
  -				else if (XMLString::equals(value, kw_smtp))
  +				else if (XMLString::equals(value.c_str(), kw_smtp))
   					m_CurTrType = APTSMTP;
   				else
   				{
  @@ -273,26 +271,32 @@
   
   void WSDDDocument::GetParameters(WSDDLevels ElementType, const Attributes &attrs)
   {
  +	AxisXMLString sName, sValue, sType;
   	const AxisXMLCh *name, *value, *type;
   	bool locked;
  -	const AxisXMLCh *Localname, *Value;
  +	AxisXMLString Localname, Value;
   	for (int i = 0; i < attrs.getLength(); i++) 
   	{
  -		Localname = attrs.getLocalName(i);
  -		Value = attrs.getValue(i);
  -		if (XMLString::equals(Localname, kw_name))
  +		Localname = __XTRC(attrs.getLocalName(i));
  +		Value = __XTRC(attrs.getValue(i));
  +		if (XMLString::equals(Localname.c_str(), kw_name))
   		{
  -			name = Value;
  +			sName = Value.c_str();
   		}
  -		else if (XMLString::equals(Localname, kw_value))
  +		else if (XMLString::equals(Localname.c_str(), kw_value))
   		{
  -			value = Value;
  +			sValue = Value.c_str();
   		}
  -		else if (XMLString::equals(Localname, kw_type))
  +		else if (XMLString::equals(Localname.c_str(), kw_type))
   		{
  -			type = Value;
  +			sType = Value.c_str();
   		}
   	}
  +	
  +	name = sName.c_str();
  +	value = sValue.c_str();
  +	type = sType.c_str();
  +
   	switch(ElementType)
   	{
   	case WSDD_GLOBCONF: //parameters just inside globalConfiguration
  @@ -305,20 +309,20 @@
   		}
   		else if(XMLString::equals(name, kw_cn))
   		{
  -			m_pService->SetLibName(__XTRC(value));
  -			if (m_pLibNameIdMap->find(__XTRC(value)) != m_pLibNameIdMap->end()) //libray name
already in the map
  +			m_pService->SetLibName(value);
  +			if (m_pLibNameIdMap->find(value) != m_pLibNameIdMap->end()) //libray name already
in the map
   			{
  -				m_pService->SetLibId((*m_pLibNameIdMap)[__XTRC(value)]);
  +				m_pService->SetLibId((*m_pLibNameIdMap)[value]);
   			}
   			else
   			{
  -				(*m_pLibNameIdMap)[__XTRC(value)] = ++m_nLibId;
  -				m_pService->SetLibId((*m_pLibNameIdMap)[__XTRC(value)]);
  +				(*m_pLibNameIdMap)[value] = ++m_nLibId;
  +				m_pService->SetLibId((*m_pLibNameIdMap)[value]);
   			}
   		}
   		else if (XMLString::equals(name, kw_scope))
   		{
  -			m_pService->SetScope(__XTRC(value));
  +			m_pService->SetScope(value);
   		}
   		else if (XMLString::equals(name, kw_ar))
   		{
  @@ -326,23 +330,17 @@
   		}
   		else
   		{
  -			//following is because __XTRC(X) cannot be used for 2 transcodes simultaneously
  -			//because it uses the same m_Buffer.
  -			AxisString sName = __XTRC(name);
  -			m_pService->AddParameter(sName.c_str(), __XTRC(value));
  +			m_pService->AddParameter(name, value);
   		}
   		break;
   	case WSDD_HANDLER:
   		if (XMLString::equals(name, kw_scope))
   		{
  -			m_pHandler->SetScope(__XTRC(value));
  +			m_pHandler->SetScope(value);
   		}
   		else
   		{
  -			//following is because __XTRC(X) cannot be used for 2 transcodes simultaneously
  -			//because it uses the same m_Buffer.
  -			AxisString sName = __XTRC(name);
  -			m_pHandler->AddParameter(sName.c_str(), __XTRC(value));
  +			m_pHandler->AddParameter(name, value);
   		}
   		break;
   	}
  @@ -350,7 +348,7 @@
   
   void WSDDDocument::AddAllowedRolesToService(const AxisXMLCh* value)
   {
  -	AxisString sValue = __XTRC(value);
  +	AxisString sValue = value;
   	int prepos = 0, pos = 0;
   	if (sValue.find('*') == AxisString::npos)
   	{
  @@ -366,7 +364,7 @@
   
   void WSDDDocument::AddAllowedMethodsToService(const AxisXMLCh* value)
   {
  -	AxisString sValue = __XTRC(value);
  +	AxisString sValue = value;
   	int prepos = 0, pos = 0;
   	if (sValue.find('*') == AxisString::npos)
   	{
  @@ -387,33 +385,33 @@
   		switch(m_lev0)
   		{
   		case WSDD_UNKNOWN:
  -			if(XMLString::equals(localname, kw_depl))
  +			if(XMLString::equals(__XTRC(localname), kw_depl))
   			{  
   				m_lev0 = WSDD_DEPLOYMENT;
   				//nothing to get
   			}
   			break;
   		case WSDD_DEPLOYMENT:
  -			if(XMLString::equals(localname, kw_glconf))
  +			if(XMLString::equals(__XTRC(localname), kw_glconf))
   			{  
   				m_lev0 = WSDD_GLOBCONF;
   				//nothing to get
   			}
  -			else if(XMLString::equals(localname, kw_srv))
  +			else if(XMLString::equals(__XTRC(localname), kw_srv))
   			{  
   				m_lev0 = WSDD_SERVICE;
   				m_pService = new WSDDService();
   				//get service name and proider if any
   				ProcessAttributes(WSDD_SERVICE, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_hdl))
  +			else if(XMLString::equals(__XTRC(localname), kw_hdl))
   			{  
   				m_lev0 = WSDD_HANDLER;
   				m_pHandler = new WSDDHandler();
   				ProcessAttributes(WSDD_HANDLER, attrs);
   				//get handler name and type if any
   			}
  -			else if(XMLString::equals(localname, kw_tr))
  +			else if(XMLString::equals(__XTRC(localname), kw_tr))
   			{  
   				m_lev0 = WSDD_TRANSPORT;
   				ProcessAttributes(WSDD_TRANSPORT, attrs);
  @@ -424,16 +422,16 @@
   			}
   			break;
   		case WSDD_GLOBCONF:
  -			if(XMLString::equals(localname, kw_param))
  +			if(XMLString::equals(__XTRC(localname), kw_param))
   			{  
   				GetParameters(WSDD_GLOBCONF, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_rqf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_rsf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -444,16 +442,16 @@
   			}
   		break; 
   		case WSDD_SERVICE:
  -			if(XMLString::equals(localname, kw_param))
  +			if(XMLString::equals(__XTRC(localname), kw_param))
   			{  
   				GetParameters(WSDD_SERVICE, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_rqf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_rsf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -464,19 +462,19 @@
   			}
   		break;
   		case WSDD_HANDLER:
  -			if(XMLString::equals(localname, kw_param))
  +			if(XMLString::equals(__XTRC(localname), kw_param))
   			{  
   				GetParameters(WSDD_HANDLER, attrs);
   			}
   
   		break;
   		case WSDD_TRANSPORT:
  -			if(XMLString::equals(localname, kw_rqf))
  +			if(XMLString::equals(__XTRC(localname), kw_rqf))
   			{  
   				m_lev1 = WSDD_REQFLOW;
   				ProcessAttributes(WSDD_REQFLOW, attrs);
   			}
  -			else if(XMLString::equals(localname, kw_rsf))
  +			else if(XMLString::equals(__XTRC(localname), kw_rsf))
   			{  
   				m_lev1 = WSDD_RESFLOW;
   				ProcessAttributes(WSDD_RESFLOW, attrs);
  @@ -486,19 +484,19 @@
   	}
   	else // inside a requestFlow or responseFlow elements
   	{
  -		if(XMLString::equals(localname, kw_param))
  +		if(XMLString::equals(__XTRC(localname), kw_param))
   		{  
   			GetParameters(m_lev2, attrs); //must be parameters of a handler or a chain
   		}
   
  -		else if(XMLString::equals(localname, kw_hdl))
  +		else if(XMLString::equals(__XTRC(localname), kw_hdl))
   		{  
   			m_lev2 = WSDD_HANDLER;
   			m_pHandler = new WSDDHandler();
   			ProcessAttributes(WSDD_HANDLER, attrs);
   			//get handler name and type if any
   		}
  -		else if(XMLString::equals(localname, kw_chain))
  +		else if(XMLString::equals(__XTRC(localname), kw_chain))
   		{
   
   		}
  @@ -512,16 +510,24 @@
   
   void WSDDDocument::startPrefixMapping(const XMLCh* const prefix, const XMLCh* const uri)
   {
  -	m_NsStack[prefix] = uri; //I think the same prifix cannot repeat ???
  +	m_NsStack[__XTRC(prefix)] = __XTRC(uri); //I think the same prifix cannot repeat ???
   }
   
   void WSDDDocument::endPrefixMapping(const XMLCh* const prefix)
   {
   //	string sPrifix = prefix;
  -	m_NsStack.erase(prefix); //I think the same prifix cannot repeat ???
  +	m_NsStack.erase(__XTRC(prefix)); //I think the same prifix cannot repeat ???
   }
   
   void  WSDDDocument::characters (const XMLCh *const chars, const unsigned int length)
   {
   	//cout<<"==="<<XMLString::transcode(chars)<<"==="<<endl;
  -}
  \ No newline at end of file
  +}
  +
  +const AxisChar* WSDDDocument::__XTRC(const XMLCh *pChar)
  +{
  +	if (true == (XMLString::transcode(pChar, m_Buffer, TRANSCODE_BUFFER_SIZE-1)))
  +		return m_Buffer;
  +	else 
  +		return ""; 
  +}
  
  
  
  1.7       +1 -0      xml-axis/c/src/wsdd/WSDDDocument.h
  
  Index: WSDDDocument.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDDocument.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSDDDocument.h	5 Sep 2003 10:48:51 -0000	1.6
  +++ WSDDDocument.h	11 Sep 2003 12:24:47 -0000	1.7
  @@ -107,6 +107,7 @@
   	AxisChar m_Buffer[TRANSCODE_BUFFER_SIZE]; //used to transcode XMLCh to AxisChar
   
   private:
  +	const AxisChar* __XTRC(const XMLCh* pChar);
   	void ProcessAttributes(WSDDLevels ElementType, const Attributes &attrs);
   	void GetParameters(WSDDLevels ElementType, const Attributes &attrs);
   	void AddAllowedRolesToService(const AxisXMLCh* value);
  
  
  
  1.3       +1 -1      xml-axis/c/src/wsdd/WSDDKeywords.cpp
  
  Index: WSDDKeywords.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDKeywords.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WSDDKeywords.cpp	9 Sep 2003 12:53:01 -0000	1.2
  +++ WSDDKeywords.cpp	11 Sep 2003 12:24:47 -0000	1.3
  @@ -12,7 +12,7 @@
   // Construction/Destruction
   //////////////////////////////////////////////////////////////////////
   
  -#define AX_DELETE(X) delete const_cast<unsigned short*>(X)
  +#define AX_DELETE(X) delete const_cast<AxisXMLCh*>(X)
   
   const AxisXMLCh* kw_depl;
   const AxisXMLCh* kw_srv;
  
  
  

Mime
View raw message