You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2005/03/04 18:03:12 UTC

cvs commit: ws-axis/c/src/soap Attribute.cpp Attribute.h ComplexElement.cpp HeaderBlock.cpp SoapDeSerializer.cpp SoapDeSerializer.h SoapKeywordMapping.cpp SoapSerializer.cpp

prestonf    2005/03/04 09:03:12

  Modified:    c/src/soap Attribute.cpp Attribute.h ComplexElement.cpp
                        HeaderBlock.cpp SoapDeSerializer.cpp
                        SoapDeSerializer.h SoapKeywordMapping.cpp
                        SoapSerializer.cpp
  Log:
  Hi All,
  I think this will complete what needs to be done for AXISCPP-375.
  
  Regards,
  Fred Preston.
  
  Revision  Changes    Path
  1.36      +90 -10    ws-axis/c/src/soap/Attribute.cpp
  
  Index: Attribute.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.cpp,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Attribute.cpp	1 Mar 2005 12:16:16 -0000	1.35
  +++ Attribute.cpp	4 Mar 2005 17:03:11 -0000	1.36
  @@ -42,14 +42,24 @@
   
   AXIS_CPP_NAMESPACE_START
   
  -Attribute::Attribute()
  +Attribute::Attribute( list<Attribute*> attribute)
   {
  -    
  +	if( (void *) &attribute != NULL && !attribute.empty())
  +	{
  +		list<Attribute*>::iterator itAttributeList = attribute.begin();
  +
  +		while( itAttributeList != attribute.end())
  +		{
  +			m_PrefixList.push_back( (*itAttributeList)->getPrefix());
  +
  +			itAttributeList++;
  +		}
  +	}
   }
   
   Attribute::~Attribute()
   {
  -
  +	m_PrefixList.clear();
   }
   
   int Attribute::setLocalName(const AxisChar* localname)
  @@ -58,18 +68,37 @@
   	{
           localname="";
   	}
  +
       m_localname= localname;
       return AXIS_SUCCESS;
   }
   
   int Attribute::setPrefix(const AxisChar* prefix)
   {
  -	if(NULL==prefix)
  +	if( NULL == prefix)
   	{
  -        prefix="";
  +        prefix = "";
   	}
  -	
  -    m_prefix= prefix;
  +
  +	if( (void *) &m_PrefixList != NULL && !m_PrefixList.empty())
  +	{
  +		list<const char*>::iterator itPrefixList = m_PrefixList.begin();
  +
  +		while( itPrefixList != m_PrefixList.end())
  +		{
  +			if( !strcmp( (*itPrefixList), prefix))
  +			{
  +				return AXIS_FAIL;
  +			}
  +			else
  +			{
  +				itPrefixList++;
  +			}
  +		}
  +	}
  +
  +	m_prefix = prefix;
  +
       return AXIS_SUCCESS;
   }
   
  @@ -117,31 +146,82 @@
   
   
   
  -Attribute::Attribute(const AxisChar* localname, const AxisChar* prefix, 
  +Attribute::Attribute(list<Attribute*> attribute, const AxisChar* localname, const AxisChar* prefix, 
                        const AxisChar* uri, const AxisChar* value)
   {
       m_localname= localname;
       m_prefix= prefix;
       m_uri= uri;
       m_value= value;
  +
  +	if( (void *) &attribute != NULL && !attribute.empty())
  +	{
  +		list<Attribute*>::iterator itAttributeList = attribute.begin();
  +
  +		while( itAttributeList != attribute.end())
  +		{
  +			m_PrefixList.push_back( (*itAttributeList)->getPrefix());
  +
  +			itAttributeList++;
  +		}
  +	}
  +
  +	if( prefix != NULL && strlen( prefix) > 0)
  +	{
  +		m_PrefixList.push_back( prefix);
  +	}
   }
   
  -Attribute::Attribute(const AxisChar *localname, const AxisChar *prefix, 
  +Attribute::Attribute(list<Attribute*> attribute, const AxisChar *localname, const AxisChar *prefix, 
                        const AxisChar *value)
   {
       m_localname= localname;
       m_prefix= prefix;
       m_uri= "";
       m_value= value;
  +
  +	if( (void *) &attribute != NULL && !attribute.empty())
  +	{
  +		list<Attribute*>::iterator itAttributeList = attribute.begin();
  +
  +		while( itAttributeList != attribute.end())
  +		{
  +			m_PrefixList.push_back( (*itAttributeList)->getPrefix());
  +
  +			itAttributeList++;
  +		}
  +	}
  +
  +	if( prefix != NULL && strlen( prefix) > 0)
  +	{
  +		m_PrefixList.push_back( prefix);
  +	}
   }
   
  -Attribute::Attribute(const Attribute& rCopy)
  +Attribute::Attribute(list<Attribute*> attribute, const Attribute& rCopy)
   {
       //in case sting is changed to char* use new[] and strcpy here
       this->m_localname= rCopy.m_localname; 
       this->m_prefix= rCopy.m_prefix;
       this->m_uri= rCopy.m_uri;
       this->m_value= rCopy.m_value;
  +
  +	if( (void *) &attribute != NULL && !attribute.empty())
  +	{
  +		list<Attribute*>::iterator itAttributeList = attribute.begin();
  +
  +		while( itAttributeList != attribute.end())
  +		{
  +			m_PrefixList.push_back( (*itAttributeList)->getPrefix());
  +
  +			itAttributeList++;
  +		}
  +	}
  +
  +	if( rCopy.m_prefix.length() > 0)
  +	{
  +		m_PrefixList.push_back( rCopy.m_prefix.c_str());
  +	}
   }
   
   Attribute* Attribute::clone()
  
  
  
  1.14      +10 -10    ws-axis/c/src/soap/Attribute.h
  
  Index: Attribute.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Attribute.h	1 Mar 2005 12:16:16 -0000	1.13
  +++ Attribute.h	4 Mar 2005 17:03:11 -0000	1.14
  @@ -52,32 +52,32 @@
       int serialize(SoapSerializer& pSZ) const;
       int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack, const AxisChar *uri=NULL);
   
  -    Attribute();    
  -    Attribute(const AxisChar* localname, const AxisChar* prefix, 
  +    Attribute(list<Attribute*> attribute);    
  +    Attribute(list<Attribute*> attribute, const AxisChar* localname, const AxisChar* prefix, 
           const AxisChar* uri, const AxisChar* value);
  -    Attribute(const AxisChar* localname, const AxisChar* prefix, 
  +    Attribute(list<Attribute*> attribute, const AxisChar* localname, const AxisChar* prefix, 
           const AxisChar* value);
  -    Attribute(const Attribute& rCopy);   
  +    Attribute(list<Attribute*> attribute, const Attribute& rCopy);
       Attribute* clone(); 
       virtual ~Attribute();
   
  -    int setValue(const AxisChar* value);
  -    int setURI(const AxisChar* uri);
  -    int setPrefix(const AxisChar* prefix);
  -    int setLocalName(const AxisChar* localname);
  -
       const AxisChar* getValue();
       const AxisChar* getURI();
       const AxisChar* getPrefix();
       const AxisChar* getLocalName();
   
  +    int setValue(const AxisChar* value);
  +    int setURI(const AxisChar* uri);
  +    int setPrefix(const AxisChar* prefix);
  +    int setLocalName(const AxisChar* localname);
  +
   private:    
       bool isSerializable() const;
       AxisString m_localname;
       AxisString m_prefix;
       AxisString m_uri;
       AxisString m_value;
  -
  +	list<const char*>	m_PrefixList;
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.37      +3 -3      ws-axis/c/src/soap/ComplexElement.cpp
  
  Index: ComplexElement.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.cpp,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- ComplexElement.cpp	1 Mar 2005 15:02:04 -0000	1.36
  +++ ComplexElement.cpp	4 Mar 2005 17:03:11 -0000	1.37
  @@ -151,7 +151,7 @@
           const AxisChar *prefix,
           const AxisChar *value)
   {
  -    Attribute* pAttribute = new Attribute(localname, prefix, value);
  +    Attribute* pAttribute = new Attribute(m_attributes, localname, prefix, value);
       m_attributes.push_back(pAttribute);
       
       return (IAttribute*)pAttribute;
  @@ -162,7 +162,7 @@
           const AxisChar *uri,
           const AxisChar *value)
   {
  -    Attribute* pAttribute = new Attribute(localname, prefix, uri, value);
  +    Attribute* pAttribute = new Attribute(m_attributes, localname, prefix, uri, value);
       m_attributes.push_back(pAttribute);
      
       return (IAttribute*)pAttribute;
  @@ -171,7 +171,7 @@
   IAttribute* ComplexElement::createAttribute(const AxisChar *localname,
           const AxisChar *value)
   {
  -    Attribute* pAttribute = new Attribute(localname, "", value);
  +    Attribute* pAttribute = new Attribute(m_attributes, localname, "", value);
       m_attributes.push_back(pAttribute);
                                                                                                                                                                               
       return (IAttribute*)pAttribute;
  
  
  
  1.61      +13 -13    ws-axis/c/src/soap/HeaderBlock.cpp
  
  Index: HeaderBlock.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- HeaderBlock.cpp	4 Mar 2005 14:55:12 -0000	1.60
  +++ HeaderBlock.cpp	4 Mar 2005 17:03:11 -0000	1.61
  @@ -552,12 +552,12 @@
       setLocalName("reservation");
       setURI("http://travelcompany.example.org/reservation");
   
  -    Attribute* pAttribute2 = new Attribute();
  +    Attribute* pAttribute2 = new Attribute(m_attributes);
       pAttribute2->setPrefix("SOAP-ENV");
       pAttribute2->setLocalName("role");
       pAttribute2->setValue("http://www.w3.org/2003/05/soap-envelope/role/next");
   
  -    Attribute* pAttribute3 = new Attribute();
  +    Attribute* pAttribute3 = new Attribute(m_attributes);
       pAttribute3->setPrefix("SOAP-ENV");
       pAttribute3->setLocalName("mustUnderstand");
       pAttribute3->setValue("true");
  @@ -663,14 +663,14 @@
   	{        
   		if( !strcmp( (*itCurrNamespaceDecls)->getPrefix(), pPrefix))
   		{
  -			Attribute *	pAttribute = new Attribute( pLocalName,
  +			Attribute *	pAttribute = new Attribute( m_attributes, pLocalName,
   													pPrefix,
   													(*itCurrNamespaceDecls)->getURI(),
   													pValue);
   
   			m_attributes.push_back( pAttribute);
   
  -			return NULL;
  +			return pAttribute;
   		}
   		else
   		{
  @@ -680,7 +680,7 @@
   
   // If the prefix/localname pair have not previously been defined, then create
   // and return the attribute.
  -	Attribute *	pAttribute = new Attribute( pLocalName, pPrefix, pURI, pValue);
  +	Attribute *	pAttribute = new Attribute( m_attributes, pLocalName, pPrefix, pURI, pValue);
   
   	m_attributes.push_back( pAttribute);
   
  @@ -705,17 +705,17 @@
                   switch(eStdAttrType)
                   {
                       case ACTOR:
  -                        pAttribute = new Attribute("actor",
  +                        pAttribute = new Attribute(m_attributes, "actor",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_1].pchPrefix,
                               "","http://schemas.xmlsoap.org/soap/actor/next");
                           break;
                       case MUST_UNDERSTAND_TRUE:
  -                        pAttribute = new Attribute("mustUnderstand",
  +                        pAttribute = new Attribute(m_attributes, "mustUnderstand",
                               gs_SoapEnvVersionsStruct
                               [SOAP_VER_1_1].pchPrefix,"","1");
                           break;
                       case MUST_UNDERSTAND_FALSE:
  -                        pAttribute = new Attribute("mustUnderstand",
  +                        pAttribute = new Attribute(m_attributes, "mustUnderstand",
                               gs_SoapEnvVersionsStruct
                               [SOAP_VER_1_1].pchPrefix,"","0");
                           break;
  @@ -729,27 +729,27 @@
                   switch(eStdAttrType)
                   {
                       case ROLE_NEXT:
  -                        pAttribute = new Attribute("role",
  +                        pAttribute = new Attribute(m_attributes, "role",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,
                               "", "http://www.w3.org/2003/05/soap-envelope/role/next");
                           break;
                       case ROLE_NONE:
  -                        pAttribute = new Attribute("role",
  +                        pAttribute = new Attribute(m_attributes, "role",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,
                               "", "http://www.w3.org/2003/05/soap-envelope/role/none");
                           break;
                       case ROLE_ULTIMATE_RECEIVER:
  -                        pAttribute = new Attribute("role",
  +                        pAttribute = new Attribute(m_attributes, "role",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,
                               "", "http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
                           break;
                       case MUST_UNDERSTAND_TRUE:
  -                        pAttribute = new Attribute("mustUnderstand",
  +                        pAttribute = new Attribute(m_attributes, "mustUnderstand",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,
                               "","true");
                           break;
                       case MUST_UNDERSTAND_FALSE:
  -                        pAttribute = new Attribute("mustUnderstand",
  +                        pAttribute = new Attribute(m_attributes, "mustUnderstand",
                               gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,
                               "","false");
                           break;
  
  
  
  1.151     +3 -3      ws-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- SoapDeSerializer.cpp	28 Feb 2005 07:26:09 -0000	1.150
  +++ SoapDeSerializer.cpp	4 Mar 2005 17:03:11 -0000	1.151
  @@ -126,7 +126,7 @@
       {
   	SoapEnvelope *m_pEnvl = new SoapEnvelope ();
   	/* set all attributes of SoapEnvelope */
  -	pAttr = new Attribute ();
  +	pAttr = new Attribute ( (list<Attribute*>) NULL);
   
   	pAttr->setValue (m_pNode->m_pchNamespace);
   	m_pEnvl->addNamespaceDecl (pAttr);
  @@ -151,7 +151,7 @@
   	/* Set Attributes */
   	for (int i = 0; m_pNode->m_pchAttributes[i]; i += 3)
   	{
  -	    pAttr = new Attribute ();
  +	    pAttr = new Attribute ((list<Attribute*>) NULL);
   	    pAttr->setLocalName (m_pNode->m_pchAttributes[i]);
   	    pAttr->setURI (m_pNode->m_pchAttributes[i + 1]);
   	    pAttr->setValue (m_pNode->m_pchAttributes[i + 2]);
  @@ -257,7 +257,7 @@
   
   		while (true)
   		{
  -		    Attribute *pAttribute = new Attribute ();
  +		    Attribute *pAttribute = new Attribute ((list<Attribute*>) NULL);
   		    pAttribute->setLocalName (m_pNode->
   					      m_pchAttributes
   					      [iAttributeArrayIndex++]);
  
  
  
  1.38      +1 -0      ws-axis/c/src/soap/SoapDeSerializer.h
  
  Index: SoapDeSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.h,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- SoapDeSerializer.h	18 Feb 2005 11:11:19 -0000	1.37
  +++ SoapDeSerializer.h	4 Mar 2005 17:03:11 -0000	1.38
  @@ -54,6 +54,7 @@
   class SoapEnvelope;
   class SoapHeader;
   class IHeaderBlock;
  +
   using namespace std;
   /*
    *  @class SoapDeSerializer
  
  
  
  1.15      +6 -6      ws-axis/c/src/soap/SoapKeywordMapping.cpp
  
  Index: SoapKeywordMapping.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapKeywordMapping.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SoapKeywordMapping.cpp	17 Dec 2004 11:49:46 -0000	1.14
  +++ SoapKeywordMapping.cpp	4 Mar 2005 17:03:11 -0000	1.15
  @@ -59,18 +59,18 @@
               }
           }
           /* soap 1.1 envelop attributes */
  -        m_Map[SOAP_VER_1_1].pEnv = new Attribute("SOAP-ENV","xmlns","",
  +        m_Map[SOAP_VER_1_1].pEnv = new Attribute( (std::list<Attribute*>)NULL, "SOAP-ENV","xmlns","",
               "http://schemas.xmlsoap.org/soap/envelope/");
  -        m_Map[SOAP_VER_1_1].pXsi = new Attribute("xsi","xmlns","",
  +        m_Map[SOAP_VER_1_1].pXsi = new Attribute( (std::list<Attribute*>)NULL, "xsi","xmlns","",
               "http://www.w3.org/2001/XMLSchema-instance");
  -        m_Map[SOAP_VER_1_1].pXsd = new Attribute("xsd","xmlns","",
  +        m_Map[SOAP_VER_1_1].pXsd = new Attribute( (std::list<Attribute*>)NULL, "xsd","xmlns","",
               "http://www.w3.org/2001/XMLSchema");
           /* soap 1.2 envelop attributes */
  -        m_Map[SOAP_VER_1_2].pEnv = new Attribute("env","xmlns","",
  +        m_Map[SOAP_VER_1_2].pEnv = new Attribute( (std::list<Attribute*>)NULL, "env","xmlns","",
               "http://www.w3.org/2003/05/soap-envelope");
  -        m_Map[SOAP_VER_1_2].pXsi = new Attribute("xsi","xmlns","",
  +        m_Map[SOAP_VER_1_2].pXsi = new Attribute( (std::list<Attribute*>)NULL, "xsi","xmlns","",
               "http://www.w3.org/2001/XMLSchema-instance");
  -        m_Map[SOAP_VER_1_2].pXsd = new Attribute("xsd","xmlns","",
  +        m_Map[SOAP_VER_1_2].pXsd = new Attribute( (std::list<Attribute*>)NULL, "xsd","xmlns","",
               "http://www.w3.org/2001/XMLSchema");
           m_bInit = true;
       }
  
  
  
  1.101     +1 -1      ws-axis/c/src/soap/SoapSerializer.cpp
  
  Index: SoapSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.cpp,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- SoapSerializer.cpp	28 Feb 2005 14:51:49 -0000	1.100
  +++ SoapSerializer.cpp	4 Mar 2005 17:03:11 -0000	1.101
  @@ -1175,7 +1175,7 @@
   
   void SoapSerializer::addNamespaceToEnvelope(AxisChar *pachNamespaceURI, AxisChar* pachPrefix)
   {
  -	Attribute *pNameSpace = new Attribute(pachPrefix, "xmlns", pachNamespaceURI);
  +	Attribute *pNameSpace = new Attribute((std::list<Attribute*>)NULL, pachPrefix, "xmlns", pachNamespaceURI);
   
   	m_pSoapEnvelope->addNamespaceDecl(pNameSpace);