lilantha    2003/06/12 21:34:02

  Modified:    contrib/Axis-C++/src/Message SOAPEnvelope.cpp
                        SOAPEnvelope.hpp
  Log:
  support only one header & a body
  
  Revision  Changes    Path
  1.4       +15 -29    xml-axis/contrib/Axis-C++/src/Message/SOAPEnvelope.cpp
  
  Index: SOAPEnvelope.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/contrib/Axis-C++/src/Message/SOAPEnvelope.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SOAPEnvelope.cpp  23 Feb 2003 16:30:33 -0000      1.3
  +++ SOAPEnvelope.cpp  13 Jun 2003 04:34:02 -0000      1.4
  @@ -4,7 +4,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -70,47 +70,37 @@
   
   
   SOAPEnvelope::SOAPEnvelope()
  +:m_pSOAPHeader(0), m_pSOAPBody(0)
   {
        m_qName = ax::QName(ax::URI_SOAP_ENV, ax::ELEM_ENVELOPE);
  -     m_SOAPBodyItr = m_SOAPBody.begin();
  -     m_SOAPHdItr   = m_SOAPHeader.begin();    
   }
   
   SOAPEnvelope::SOAPEnvelope(const DOM_Element& p_Elm)
   {
        SetMsgElm(p_Elm);
        m_qName           = ax::QName(ax::URI_SOAP_ENV, ax::ELEM_ENVELOPE);
  -     m_SOAPBodyItr = m_SOAPBody.begin();
  -     m_SOAPHdItr   = m_SOAPHeader.begin();    
   }
   
   SOAPEnvelope::~SOAPEnvelope()
   {
        // clean up
  -     for(m_SOAPHdItr = m_SOAPHeader.begin(); m_SOAPHdItr != m_SOAPHeader.end(); 
++m_SOAPHdItr)
  -             delete (*m_SOAPHdItr);
  -
  -     m_SOAPHeader.clear();
  -
  -     for(m_SOAPBodyItr = m_SOAPBody.begin(); m_SOAPBodyItr != m_SOAPBody.end(); 
++m_SOAPBodyItr)
  -             delete (*m_SOAPBodyItr);
  -
  -     m_SOAPBody.clear();
  +     delete m_pSOAPHeader;
  +     delete m_pSOAPBody;
   }
   
   void SOAPEnvelope::AddSOAPBodyElement(SOAPBodyElement *p_pBody)
   {
  -     m_SOAPBody.push_back(p_pBody);
  +     m_pSOAPBody = p_pBody;
   }
   
   const MessageElement* SOAPEnvelope::GetSOAPBodyElement()
   {
  -     return (m_SOAPBody.size())?m_SOAPBody[0]:new MessageElement; // for the moment 
return the first body element for RPC
  +     return (m_pSOAPBody)?m_pSOAPBody:new MessageElement; // for the moment return 
the first body element for RPC
   }
   
   void SOAPEnvelope::AddSOAPHeader(SOAPHeader *p_pHd)
   {
  -     m_SOAPHeader.push_back(p_pHd);
  +     m_pSOAPHeader= p_pHd;
   }
   
   bool SOAPEnvelope::RmSOAPBodyElement(const SOAPBodyElement& p_Body)
  @@ -153,26 +143,22 @@
        AttList attList;
       serilizer.StartElem(m_qName, attList);
        
  -     // Serialize all the headers
  -     for(m_SOAPHdItr = m_SOAPHeader.begin(); m_SOAPHdItr != m_SOAPHeader.end(); 
++m_SOAPHdItr)
  -             (*m_SOAPHdItr)->Serialize(serilizer);
  -
  -     // Serialize all the body elements
  -     for(m_SOAPBodyItr = m_SOAPBody.begin(); m_SOAPBodyItr != m_SOAPBody.end(); 
++m_SOAPBodyItr)
  -             (*m_SOAPBodyItr)->Serialize(serilizer);
  +     // Serialize the headers
  +     m_pSOAPHeader->Serialize(serilizer);
  +
  +     // Serialize the body elements
  +     m_pSOAPBody->Serialize(serilizer);
        
        serilizer.flush();
   }
   
   void SOAPEnvelope::DeSerialize(XMLDeSerializer& dserilizer)
   {
  -     // DeSerialize all the headers
  -     for(m_SOAPHdItr = m_SOAPHeader.begin(); m_SOAPHdItr != m_SOAPHeader.end(); 
++m_SOAPHdItr)
  -             (*m_SOAPHdItr)->DeSerialize(dserilizer);
  +     // DeSerialize the headers
  +     m_pSOAPHeader->DeSerialize(dserilizer);
   
        // DeSerialize all the body elements
  -     for(m_SOAPBodyItr = m_SOAPBody.begin(); m_SOAPBodyItr != m_SOAPBody.end(); 
++m_SOAPBodyItr)
  -             (*m_SOAPBodyItr)->DeSerialize(dserilizer);
  +     m_pSOAPBody->DeSerialize(dserilizer);
   }
   
   
  
  
  
  1.4       +4 -7      xml-axis/contrib/Axis-C++/src/Message/SOAPEnvelope.hpp
  
  Index: SOAPEnvelope.hpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/contrib/Axis-C++/src/Message/SOAPEnvelope.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SOAPEnvelope.hpp  23 Feb 2003 16:30:33 -0000      1.3
  +++ SOAPEnvelope.hpp  13 Jun 2003 04:34:02 -0000      1.4
  @@ -4,7 +4,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2002 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -108,12 +108,9 @@
        }
   
   private:
  -     std::vector<SOAPBodyElement*> m_SOAPBody;       ///< for RPC this have only 
one entry for the time being
  -     std::vector<SOAPHeader*>          m_SOAPHeader; ///< for RPC this have only 
one entry for the time being
  -
  -     std::vector<SOAPBodyElement*>::iterator m_SOAPBodyItr;///< for RPC this have 
only one entry for the time being
  -     std::vector<SOAPHeader*>::iterator          m_SOAPHdItr;         ///< for RPC 
this have only one entry for the time being
  -
  +     SOAPHeader              *m_pSOAPHeader; ///< for RPC this have only one entry 
for the time being
  +     SOAPBodyElement *m_pSOAPBody;   ///< for RPC this have only one entry for the 
time being
  +     
   };
   
   
  
  
  

Reply via email to