00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
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
00315
00316
00317
00318
00319
00320
00321
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