Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Examples  

HeaderBlock.h

00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00017 
00018 #if !defined(_HEADERBLOCK_H____OF_AXIS_INCLUDED_)
00019 #define _HEADERBLOCK_H____OF_AXIS_INCLUDED_
00020 
00021 #include "Attribute.h"
00022 #include <string>
00023 #include <list>
00024 
00025 using namespace std;
00026 
00027 class BasicNode;
00028 #include "IHeaderBlock.h"
00029 #include "SoapEnvVersions.h"
00030 
00031 /*
00032  *  @class BasicNode
00033  *  @brief    The Header block of a SOAP Header according to 
00034  *  SOAP 1.2 specification.
00035  *   
00036  *  The Header block of a SOAP Header according to SOAP 1.2 specification.
00037  *
00038  *  Each child element information item of the SOAP Header is called a 
00039  *  SOAP header block. Each SOAP header block element information item:
00040  *    - MUST have a [namespace name] property which has a value, 
00041  *      that is the name of the element MUST be namespace qualified.
00042  *    - MAY have any number of character information item children. 
00043  *      Child character information items whose character code is amongst 
00044  *      the white space characters as defined by XML 1.0 [XML 1.0] are 
00045  *      considered significant.
00046  *    - MAY have any number of element information item children. Such element 
00047  *      information items MAY be namespace qualified.
00048  *    - MAY have zero or more attribute information items in its [attributes] 
00049  *       property. Among these MAY be any or all of the following, which have 
00050  *       special significance for SOAP processing:
00051  *    - encodingStyle attribute information item 
00052  *    - role attribute information item 
00053  *    - mustUnderstand attribute information item     
00054  *    - relay attribute information item 
00055  *
00056  *    
00057  *    
00058  *  @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
00059  *  @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
00060  *
00061  */
00062 
00063 /*
00064  * Revision 1.1  2004/05/26 samisa
00065  * Added copy constructor and clone
00066  */
00067 
00068 /*
00069  * Revision 1.2  2004/06/13 roshan
00070  * Added doxygen comments to help autobuild API docs
00071  */
00072 
00073 class HeaderBlock : public IHeaderBlock
00074 {
00075 friend class SoapHeader;
00076 
00077 private:   
00081     int iNoOFChildren;
00082     
00086     int serializeNamespaceDecl(SoapSerializer& pSZ);
00087 
00088     int serializeChildren(SoapSerializer& pSZ, 
00089         list<AxisChar*>& lstTmpNameSpaceStack);
00090 
00094     list<BasicNode*> m_children;
00095 
00096     bool isSerializable();
00097 
00098     int attrSerialize(SoapSerializer& pSZ, 
00099         list<AxisChar*>& lstTmpNameSpaceStack);
00100 
00101     AxisString m_localname;
00102     AxisString m_sPrefix;
00103     AxisString m_uri;
00104     list<Attribute*> m_attributes;
00105     list<Attribute*> m_namespaceDecls;
00106 
00107 public:
00108     const BasicNode* getFirstChild();
00109 
00115     int getNoOfChildren();
00116 
00144     BasicNode* createChild(NODE_TYPE eNODE_TYPE,  
00145         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00146         AxisChar* pachValue);
00147 
00148 #ifdef UNIT_TESTING_ON
00149     int initializeForTesting();
00150 #endif
00151 
00172     BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, 
00173         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00174         AxisChar* pachValue);
00175 
00181     void addAttribute(Attribute* attr);
00182 
00212     Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
00213         SOAP_VERSION eSOAP_VERSION);
00214 
00225     Attribute* createAttribute(const AxisChar* localname, 
00226         const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
00227 
00237     Attribute* createAttribute(const AxisChar* localname, 
00238         const AxisChar* prefix, const AxisChar* value);
00239 
00252     BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE);
00253 
00268     BasicNode* createChild(NODE_TYPE eNODE_TYPE);
00269 
00277     const BasicNode* getLastChild();
00278 
00288     const BasicNode* getChild(int iChildPosition);
00289 
00296     int addChild(BasicNode* pBasicNode);
00297 
00303     void setLocalName(const AxisChar* localname);
00304 
00310     void setUri(const AxisChar* uri);
00311 
00312     /*
00313       * Sets the prefix of this Header Block.
00314       *
00315       * @param prefix The prefix to set in.
00316       */
00317         /* Commented by Susantha - 21/06/2004
00318          * The prefix should be decided by the Serializer at runtime
00319          *
00320     void setPrefix(const AxisChar* prefix);
00321         */
00329     int addNamespaceDecl(Attribute *pAttribute);
00330 
00338     HeaderBlock(const AxisChar* pachLocalName, const AxisChar* pachUri);
00339 
00343     HeaderBlock();
00344 
00350     HeaderBlock(const HeaderBlock& rCopy);
00351 
00357     IHeaderBlock* clone();
00358 
00362     virtual ~HeaderBlock();
00363 
00364     bool operator ==( const HeaderBlock &objHeaderBlock);
00365 
00366     int serialize(SoapSerializer& pSZ);    
00367 
00371     int initializeForTesting();
00372 
00373 };
00374 
00375 #endif 
00376 

Generated on Tue Jun 29 09:27:56 2004 for AxisC++ by doxygen1.2.18