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 class BasicNode;
00022 #include "IHeaderBlock.h"
00023 #include <string>
00024 
00025 using namespace std;
00026 
00027 /*
00028  *  @class BasicNode
00029  *  @brief    The Header block of a SOAP Header according to 
00030  *  SOAP 1.2 specification.
00031  *   
00032  *  The Header block of a SOAP Header according to SOAP 1.2 specification.
00033  *
00034  *  Each child element information item of the SOAP Header is called a 
00035  *  SOAP header block. Each SOAP header block element information item:
00036  *    - MUST have a [namespace name] property which has a value, 
00037  *      that is the name of the element MUST be namespace qualified.
00038  *    - MAY have any number of character information item children. 
00039  *      Child character information items whose character code is amongst 
00040  *      the white space characters as defined by XML 1.0 [XML 1.0] are 
00041  *      considered significant.
00042  *    - MAY have any number of element information item children. Such element 
00043  *      information items MAY be namespace qualified.
00044  *    - MAY have zero or more attribute information items in its [attributes] 
00045  *       property. Among these MAY be any or all of the following, which have 
00046  *       special significance for SOAP processing:
00047  *    - encodingStyle attribute information item 
00048  *    - role attribute information item 
00049  *    - mustUnderstand attribute information item     
00050  *    - relay attribute information item 
00051  *
00052  *    
00053  *    
00054  *  @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
00055  *  @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
00056  *
00057  */
00058 
00059 /*
00060  * Revision 1.1  2004/05/26 samisa
00061  * Added copy constructor and clone
00062  */
00063 
00064 /*
00065  * Revision 1.2  2004/06/13 roshan
00066  * Added doxygen comments to help autobuild API docs
00067  */
00068 
00069 class HeaderBlock : public IHeaderBlock
00070 {
00071 friend class SoapHeader;
00072 
00073 private:   
00077     int iNoOFChildren;
00078     
00082     int serializeNamespaceDecl(SoapSerializer& pSZ);
00083 
00084     int serializeChildren(SoapSerializer& pSZ, 
00085         list<AxisChar*>& lstTmpNameSpaceStack);
00086 
00090     list<BasicNode*> m_children;
00091 
00092     bool isSerializable();
00093 
00094     int attrSerialize(SoapSerializer& pSZ, 
00095         list<AxisChar*>& lstTmpNameSpaceStack);
00096 
00097     AxisString m_localname;
00098     AxisString m_sPrefix;
00099     AxisString m_uri;
00100     list<Attribute*> m_attributes;
00101     list<Attribute*> m_namespaceDecls;
00102 
00103 public:
00104     const BasicNode* getFirstChild();
00105 
00111     int getNoOfChildren();
00112 
00140     BasicNode* createChild(NODE_TYPE eNODE_TYPE,  
00141         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00142         AxisChar* pachValue);
00143 
00144 #ifdef UNIT_TESTING_ON
00145     int initializeForTesting();
00146 #endif
00147 
00170     BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, 
00171         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00172         AxisChar* pachValue);
00173 
00179     void addAttribute(Attribute* attr);
00180 
00210     Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
00211         SOAP_VERSION eSOAP_VERSION);
00212 
00226     Attribute* createAttribute(const AxisChar* localname, 
00227         const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
00228 
00238     Attribute* createAttribute(const AxisChar* localname, 
00239         const AxisChar* prefix, const AxisChar* value);
00240 
00253     BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE);
00254 
00269     BasicNode* createChild(NODE_TYPE eNODE_TYPE);
00270 
00278     const BasicNode* getLastChild();
00279 
00289     const BasicNode* getChild(int iChildPosition);
00290 
00297     int addChild(BasicNode* pBasicNode);
00298 
00304     void setLocalName(const AxisChar* localname);
00305 
00311     void setUri(const AxisChar* uri);
00312 
00313     /*
00314       * Sets the prefix of this Header Block.
00315       *
00316       * @param prefix The prefix to set in.
00317       */
00318         /* Commented by Susantha - 21/06/2004
00319          * The prefix should be decided by the Serializer at runtime
00320          *
00321     void setPrefix(const AxisChar* prefix);
00322         */
00331     int addNamespaceDecl(Attribute *pAttribute);
00332 
00340     HeaderBlock(const AxisChar* pachLocalName, const AxisChar* pachUri);
00341 
00345     HeaderBlock();
00346 
00352     HeaderBlock(const HeaderBlock& rCopy);
00353 
00359     IHeaderBlock* clone();
00360 
00364     virtual ~HeaderBlock();
00365 
00366     bool operator ==( const HeaderBlock &objHeaderBlock);
00367 
00368     int serialize(SoapSerializer& pSZ);    
00369 
00370 };
00371 
00372 #endif 
00373 

Generated on Fri Jul 9 13:18:29 2004 for AxisC++ by doxygen1.2.18