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/soap SoapHeader.h SoapHeader.cpp
Date Fri, 27 Jun 2003 03:53:08 GMT
roshan      2003/06/26 20:53:08

  Modified:    c/src/soap SoapHeader.h SoapHeader.cpp
  Log:
  committing c++ code base
  
  Revision  Changes    Path
  1.2       +10 -4     xml-axis/c/src/soap/SoapHeader.h
  
  Index: SoapHeader.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapHeader.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SoapHeader.h	25 Jun 2003 07:39:08 -0000	1.1
  +++ SoapHeader.h	27 Jun 2003 03:53:08 -0000	1.2
  @@ -57,7 +57,7 @@
    *
    *
    *
  - * @author Roshan
  + * @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
    *
    */
   
  @@ -72,18 +72,24 @@
   #pragma once
   #endif // _MSC_VER > 1000
   
  -#include "HeaderEntry.h"
  +#include "HeaderBlock.h"
   #include "SoapEnvVersions.h"
   
   class SoapHeader  
   {
   private:
  -	list<HeaderEntry*> m_headerEntries;
  +	int serializeNamespaceDecl(string&);
  +	int serializeAttributes(string&);
  +	list<Attribute*> m_attributes;
  +	list<Attribute*> m_namespaceDecls;
  +	list<HeaderBlock*> m_headerEntries;
   	//string m_strHeaderSerialized;
   public:
  +	int addNamespaceDecl(Attribute* pAttribute);
  +	int addAttribute(Attribute* pAttribute);
   	//string& serialize();
   	int serialize(string&, SOAP_VERSION eSoapVersion);
  -	void addHeaderEntry(HeaderEntry* headerEntry);
  +	void addHeaderBlock(HeaderBlock* headerBlock);
   	SoapHeader();
   	virtual ~SoapHeader();
   
  
  
  
  1.2       +75 -16    xml-axis/c/src/soap/SoapHeader.cpp
  
  Index: SoapHeader.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapHeader.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SoapHeader.cpp	25 Jun 2003 07:39:08 -0000	1.1
  +++ SoapHeader.cpp	27 Jun 2003 03:53:08 -0000	1.2
  @@ -57,7 +57,7 @@
    *
    *
    *
  - * @author Roshan
  + * @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
    *
    */
   
  @@ -79,19 +79,30 @@
   
   SoapHeader::~SoapHeader()
   {
  -	list<HeaderEntry*>::iterator itCurrHeaderEntry= m_headerEntries.begin();
  +	//deletion of Header Entries
  +	list<HeaderBlock*>::iterator itCurrHeaderBlock= m_headerEntries.begin();
   
  -	while(itCurrHeaderEntry != m_headerEntries.end()) {		
  -		delete *itCurrHeaderEntry;
  -		itCurrHeaderEntry++;
  +	while(itCurrHeaderBlock != m_headerEntries.end()) {		
  +		delete *itCurrHeaderBlock;
  +		itCurrHeaderBlock++;
   	}
   
   	m_headerEntries.clear();
  +
  +	//deletion of attributes
  +	list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
  +
  +	while(itCurrAttribute != m_attributes.end()) {		
  +		delete *itCurrAttribute;
  +		itCurrAttribute++;
  +	}
  +
  +	m_attributes.clear();
   }
   
  -void SoapHeader::addHeaderEntry(HeaderEntry* headerEntry)
  +void SoapHeader::addHeaderBlock(HeaderBlock* headerBlock)
   {
  -	m_headerEntries.push_back(headerEntry);
  +	m_headerEntries.push_back(headerBlock);
   }
   
   int SoapHeader::serialize(string& sSerialized, SOAP_VERSION eSoapVersion)
  @@ -99,16 +110,25 @@
   	int iStatus= SUCCESS;
   
   	do {
  -		sSerialized= sSerialized+ "<"+ g_sObjSoapEnvVersionsStruct[eSoapVersion].pchEnvelopePrefix+
":" + g_sObjSoapEnvVersionsStruct[eSoapVersion].pcharWords[SKW_HEADER] + ">"+ "\n";	
  +		sSerialized= sSerialized+ "<"+ g_sObjSoapEnvVersionsStruct[eSoapVersion].pchEnvelopePrefix+
":" + g_sObjSoapEnvVersionsStruct[eSoapVersion].pcharWords[SKW_HEADER];	
   
  -		list<HeaderEntry*>::iterator itCurrHeaderEntry= m_headerEntries.begin();
  +		iStatus= serializeNamespaceDecl(sSerialized);
  +		iStatus= serializeAttributes(sSerialized);
  +
  +		if(iStatus==FAIL) {
  +			break;
  +		}
   
  -		while(itCurrHeaderEntry != m_headerEntries.end()) {
  -			iStatus= (*itCurrHeaderEntry)->serialize(sSerialized);
  +		sSerialized= sSerialized+ ">"+ "\n";
  +
  +		list<HeaderBlock*>::iterator itCurrHeaderBlock= m_headerEntries.begin();
  +
  +		while(itCurrHeaderBlock != m_headerEntries.end()) {
  +			iStatus= (*itCurrHeaderBlock)->serialize(sSerialized);
   			if(iStatus==FAIL) {
   				break;
   			}
  -			itCurrHeaderEntry++;
  +			itCurrHeaderBlock++;
   			sSerialized+="\n";
   		}
   
  @@ -131,11 +151,11 @@
   
   	m_strHeaderSerialized= "<SOAP-ENV:Header>";
   
  -	list<HeaderEntry*>::iterator itCurrHeaderEntry= m_headerEntries.begin();
  +	list<HeaderBlock*>::iterator itCurrHeaderBlock= m_headerEntries.begin();
   
  -	while(itCurrHeaderEntry != m_headerEntries.end()) {
  -		m_strHeaderSerialized= m_strHeaderSerialized + (*itCurrHeaderEntry)->serialize();
  -		itCurrHeaderEntry++;
  +	while(itCurrHeaderBlock != m_headerEntries.end()) {
  +		m_strHeaderSerialized= m_strHeaderSerialized + (*itCurrHeaderBlock)->serialize();
  +		itCurrHeaderBlock++;
   	}
   
   	m_strHeaderSerialized= m_strHeaderSerialized + "</SOAP-ENV:Header>";
  @@ -143,3 +163,42 @@
   	return m_strHeaderSerialized;
   
   }*/
  +
  +int SoapHeader::addAttribute(Attribute *pAttribute)
  +{
  +	m_attributes.push_back(pAttribute);
  +
  +	return SUCCESS;
  +}
  +
  +int SoapHeader::serializeAttributes(string& sSerialized)
  +{
  +	list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
  +
  +	while(itCurrAttribute != m_attributes.end()) {		
  +		(*itCurrAttribute)->serialize(sSerialized);
  +		itCurrAttribute++;		
  +	}	
  +
  +	return SUCCESS;	
  +}
  +
  +int SoapHeader::addNamespaceDecl(Attribute *pAttribute)
  +{
  +	m_namespaceDecls.push_back(pAttribute);
  +
  +	return SUCCESS;
  +}
  +
  +int SoapHeader::serializeNamespaceDecl(string& sSerialized)
  +{
  +	list<Attribute*>::iterator itCurrNamespaceDecl= m_namespaceDecls.begin();
  +
  +	while(itCurrNamespaceDecl != m_namespaceDecls.end()) {			
  +
  +		(*itCurrNamespaceDecl)->serialize(sSerialized);
  +		itCurrNamespaceDecl++;		
  +	}	
  +
  +	return SUCCESS;
  +}
  
  
  

Mime
View raw message