You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2004/06/13 16:19:23 UTC
cvs commit: ws-axis/c/include/axis/server BasicNode.h CharacterElement.h HeaderBlock.h IHeaderBlock.h SoapHeader.h
roshan 2004/06/13 07:19:23
Modified: c/include/axis/client Stub.h
c/include/axis/server BasicNode.h CharacterElement.h
HeaderBlock.h IHeaderBlock.h SoapHeader.h
Log:
added doxygen comments to automate API building
Revision Changes Path
1.12 +14 -0 ws-axis/c/include/axis/client/Stub.h
Index: Stub.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/client/Stub.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Stub.h 11 Jun 2004 10:58:36 -0000 1.11
+++ Stub.h 13 Jun 2004 14:19:23 -0000 1.12
@@ -52,6 +52,11 @@
* Added doxygen comments to help autobuild API docs
*/
+/*
+ * Revision 1.6 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
+
#if !defined(_STUB_H____OF_AXIS_INCLUDED_)
#define _STUB_H____OF_AXIS_INCLUDED_
@@ -341,11 +346,20 @@
/**
* Sets a Attribute to the SOAPMethod, using the given Attribute data.
+ *
+ * @param pLocalname The local name of the Attribute.
+ * @param pPrefix The prefix of the Attribute.
+ * @param pValue The value of the Attribute.
*/
void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const AxisChar *pValue);
/**
* Sets a Attribute to the SOAPMethod, using the given Attribute data.
+ *
+ * @param pLocalname The local name of the Attribute.
+ * @param pPrefix The prefix of the Attribute.
+ * @param pUri The namespace uri of the Attribute.
+ * @param pValue The value of the Attribute.
*/
void setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const AxisChar* pUri, const AxisChar *pValue);
1.11 +100 -9 ws-axis/c/include/axis/server/BasicNode.h
Index: BasicNode.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/BasicNode.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- BasicNode.h 1 Jun 2004 06:42:18 -0000 1.10
+++ BasicNode.h 13 Jun 2004 14:19:23 -0000 1.11
@@ -27,6 +27,7 @@
class SoapSerializer;
enum NODE_TYPE { ELEMENT_NODE=1, CHARACTER_NODE};
+
/*
* @class BasicNode
* @brief interface for the BasicNode class.
@@ -41,27 +42,108 @@
* Added constructors, copy constructure and pure virtual clone for copy constructing derived classes
*/
+/*
+ * Revision 1.2 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
+
class BasicNode
{
public:
- /*
- * Returns the number of child elements of this element. The return value
- * depends on the TYPE of the node.
- * @return The number of child elements of this element. The return value
- * depends on the TYPE of the node.
- */
+ /**
+ * Returns the number of child elements of this element. The operation
+ * behavior depends on the TYPE of the node.
+ *
+ * @return The number of child elements of this element. The return value
+ * behavior depends on the TYPE of the node.
+ */
virtual int getNoOfChildren() = 0;
+
+ /**
+ * Gets the first Child Node of this Complex Element. The operation
+ * behavior depends on the TYPE of the node.
+ *
+ * @return The first Child Node of this Element.
+ */
virtual const BasicNode* getFirstChild() const = 0;
+
+ /**
+ * Gets the last Child Node of this Complex Element. The operation
+ * behavior depends on the TYPE of the node.
+ *
+ * @return The last Child Node of this Element.
+ */
virtual const BasicNode* getLastChild() const = 0;
+
+ /**
+ * Get the Child Node of the given position. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param iChildPosition The child position.
+ * @return The Child Node of the given position.
+ */
virtual const BasicNode* getChild(int iChildPosition) const = 0;
- /* virtual bool operator ==( const BasicNode &objChEle)=0; */
+
+ /**
+ * Adds the given child node to this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param pBasicNode the child node to be added to this Element.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
+ virtual int addChild(BasicNode* pBasicNode) =0;
+
+ /**
+ * Gets the Node Type of the Element.
+ *
+ * @return The Node Type of the Element.
+ */
+ virtual NODE_TYPE getNodeType() const =0;
+
+ /**
+ * Gets and return the value of this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @return The value of this Element.
+ */
virtual const AxisChar* getValue() const =0;
+
+ /**
+ * Sets the value of this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param pachValue The value to be set
+ * @return AXIS_SUCCESS to indicate success.
+ */
virtual int setValue(const AxisChar* pachValue)=0;
- virtual NODE_TYPE getNodeType() const =0;
+
+ /**
+ * Sets the namespace URI of this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param pachURI the namespace URI of this Element.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
virtual int setURI(const AxisChar* sURI) =0;
- virtual int addChild(BasicNode* pBasicNode) =0;
+
+ /**
+ * Sets the local name of this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param pachLocalName the local name of this Element.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
virtual int setLocalName(const AxisChar* sLocalName) =0;
+
+ /**
+ * Sets the prefix of this Element. The operation behavior
+ * depends on the TYPE of the node.
+ *
+ * @param pachPrefix the prefix of this Element.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
virtual int setPrefix(const AxisChar* sPrefix) =0;
+
virtual int serialize(SoapSerializer& pSZ) =0;
virtual int serialize(SoapSerializer& pSZ,
list<AxisChar*>& lstTmpNameSpaceStack) =0;
@@ -72,7 +154,16 @@
virtual ~BasicNode();
protected:
+ /**
+ * Used to store the Node Type, which is either ELEMENT_NODE or
+ * CHARACTER_NODE.
+ */
NODE_TYPE m_iNodeType;
+
+ /**
+ * Used to store the value. The usage of this variable depends on the TYPE
+ * of the node.
+ */
AxisChar* m_pachValue;
};
1.10 +116 -61 ws-axis/c/include/axis/server/CharacterElement.h
Index: CharacterElement.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/CharacterElement.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- CharacterElement.h 25 May 2004 12:13:21 -0000 1.9
+++ CharacterElement.h 13 Jun 2004 14:19:23 -0000 1.10
@@ -12,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*
*/
@@ -21,6 +20,10 @@
* Added copy constructure and clone for copy constructing derived classes
*/
+/*
+ * Revision 1.2 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
#if !defined(_CHARACTERELEMENT_H____OF_AXIS_INCLUDED_)
@@ -31,99 +34,151 @@
#endif
#include "BasicNode.h"
-/*
- * @class CharacterElement
- * @brief interface for the CharacterElement class.
+
+/**
+ * @class CharacterElement
+ * @brief interface for the CharacterElement class.
*
- * @author Roshan Weerasuriya (roshan@jkcs.slt.lk, roshan@opensource.lk)
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
+ * @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*/
class CharacterElement : public BasicNode
{
public:
bool operator ==( const CharacterElement &objChEle);
+
+ /**
+ * Sets the value of this Character Element
+ *
+ * @param pachValue The value to be set
+ * @return AXIS_SUCCESS to indicate success.
+ */
int setValue(const AxisChar* pachValue);
+
+ /**
+ * Gets and return the value of this Character Element
+ *
+ * @return The value of this Character Element.
+ */
const AxisChar* getValue() const;
- /*
- * This method is overridden to return 0 always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return 0.
- */
+ /**
+ * This method is overridden to return 0 always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @return Always return 0.
+ */
int getNoOfChildren() {return 0;}
- /*
- * This method is overridden to return NULL always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return NULL to indicate unsuccessfull operation.
- */
+ /**
+ * This method is overridden to return NULL always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @return Always return NULL to indicate unsuccessfull operation.
+ */
const BasicNode* getFirstChild() const {return NULL;}
- /*
- * This method is overridden to return NULL always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return NULL to indicate unsuccessfull operation.
- */
+ /**
+ * This method is overridden to return NULL always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @return Always return NULL to indicate unsuccessfull operation.
+ */
const BasicNode* getLastChild() const {return NULL;}
- /*
- * This method is overridden to return NULL always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return NULL to indicate unsuccessfull operation.
- */
+ /**
+ * This method is overridden to return NULL always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @param iChildPosition The child position.
+ * @return Always return NULL to indicate unsuccessfull operation.
+ */
const BasicNode* getChild(int iChildPosition) const {return NULL;}
- /*
- * This method is overridden to return fail(AXIS_FAIL) always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
- * operation.
- */
+ /**
+ * This method is overridden to return fail(AXIS_FAIL) always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @param sURI The namespace URI.
+ * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
+ * operation.
+ */
int setURI(const AxisChar* sURI) {return AXIS_FAIL;}
- /*
- * This method is overridden to return fail(AXIS_FAIL) always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
- * operation.
- */
+ /**
+ * This method is overridden to return fail(AXIS_FAIL) always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @param pBasicNode The child to be added.
+ * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
+ * operation.
+ */
int addChild(BasicNode* pBasicNode) {return AXIS_FAIL;}
- /*
- * This method is overridden to return fail(AXIS_FAIL) always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
- * operation.
- */
+ /**
+ * This method is overridden to return fail(AXIS_FAIL) always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @param sLocalName The localname.
+ * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
+ * operation.
+ */
int setLocalName(const AxisChar* sLocalName) {return AXIS_FAIL;}
- /*
- * This method is overridden to return fail(AXIS_FAIL) always because this
- * is a CharacterElement.
- * A user of a CharacterElement should not use this method.
- * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
- * operation.
- */
+ /**
+ * This method is overridden to return fail(AXIS_FAIL) always because this
+ * is a CharacterElement.
+ * A user of a CharacterElement should not use this method.
+ *
+ * @param sPrefix The prefix.
+ * @return Always return fail (AXIS_FAIL) to indicate unsuccessfull
+ * operation.
+ */
int setPrefix(const AxisChar* sPrefix) {return AXIS_FAIL;}
int serialize(SoapSerializer& pSZ);
- /*
- * This method is actualy not used in this class. This method was just
- * included to adhere its interface.
- */
+
+ /**
+ * This method is actualy not used in this class. This method was just
+ * included to adhere its interface.
+ */
int serialize(SoapSerializer& pSZ,
list<AxisChar*>& lstTmpNameSpaceStack) {return AXIS_SUCCESS;}
+
+ /**
+ * Returns the Node Type of this Character Element, which is
+ * CHARACTER_NODE.
+ *
+ * @return The Node Type of this Character Element, which is
+ * CHARACTER_NODE
+ */
NODE_TYPE getNodeType() const;
+
+ /**
+ * The Constructor.
+ *
+ * @param sValue The value of the Character Element.
+ */
CharacterElement(const AxisChar* sValue);
+
+ /**
+ * The Constructor.
+ */
CharacterElement();
+
CharacterElement(const CharacterElement& rCopy);
BasicNode* clone();
+
+ /**
+ * The Destructor.
+ */
virtual ~CharacterElement();
};
1.14 +163 -18 ws-axis/c/include/axis/server/HeaderBlock.h
Index: HeaderBlock.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/HeaderBlock.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- HeaderBlock.h 27 May 2004 03:56:35 -0000 1.13
+++ HeaderBlock.h 13 Jun 2004 14:19:23 -0000 1.14
@@ -55,7 +55,7 @@
*
*
*
- * @author Roshan Weerasuriya (roshan@jkcs.slt.lk, roshan@opensource.lk)
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
* @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*
*/
@@ -65,24 +65,39 @@
* Added copy constructor and clone
*/
+/*
+ * Revision 1.2 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
+
class HeaderBlock : public IHeaderBlock
{
friend class SoapHeader;
-private:
+private:
/**
- * Returns the number of child elements of this HeaderBlock.
- * @return The number of child elements of this HeaderBlock.
- */
+ * Used to store the current no of children count.
+ */
int iNoOFChildren;
+ /**
+ * Serializes the namespace decl.
+ */
int serializeNamespaceDecl(SoapSerializer& pSZ);
+
int serializeChildren(SoapSerializer& pSZ,
list<AxisChar*>& lstTmpNameSpaceStack);
+
+ /**
+ * Used to hold the child nodes.
+ */
list<BasicNode*> m_children;
+
bool isSerializable();
+
int attrSerialize(SoapSerializer& pSZ,
list<AxisChar*>& lstTmpNameSpaceStack);
+
AxisString m_localname;
AxisString m_prefix;
AxisString m_uri;
@@ -91,14 +106,46 @@
public:
const BasicNode* getFirstChild();
+
+ /**
+ * Returns the number of child elements of this HeaderBlock.
+ *
+ * @return The number of child elements of this HeaderBlock.
+ */
int getNoOfChildren();
+
+ /**
+ * Creates a child node depending on the given node type. i.e:
+ * if node type == CHARACTER_NODE then it creates a Character Element.
+ * if node type == ELEMENT_NODE then it creates a Complex Element.
+ * This method doesn't add the created child to this Header Block. If the
+ * user needs to add this created child then he has to use the
+ * addChild(BasicNode *pBasicNode) method after creating the child.
+ * If the node to be created is a CHARACTER_NODE then only the parameter
+ * pachValue will be usefull and for others you can provide NULL.
+ * If the node to be created is a ELEMENT_NODE then the parameters
+ * pachLocalName, pachPrefix, pachUri will be needed to provide and you
+ * can provide NULL for the pachValue.
+ *
+ * @param eNODE_TYPE The node type to be created, i.e CHARACTER_NODE or
+ * ELEMENT_NODE.
+ * @param pachLocalName The local name of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachPrefix The prefix of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachUri The namespace uri of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachValue The value of the child node. A ELEMENT_NODE
+ * will ignore this.
+ *
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
BasicNode* createChild(NODE_TYPE eNODE_TYPE,
AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri,
AxisChar* pachValue);
- int initializeForTesting();
-
- /*
+ /**
* Creates a child node depending on the given type. If the type is
* CHARACTER_NODE a CharacterElement is created. If the type is
* ELEMENT_NODE a ComplexElement is created. After creating the child it
@@ -107,6 +154,7 @@
* NODE_TYPE and value (pachValue) parameters will be usefull.If the type
* is ELEMENT_NODE the parameters NODE_TYPE, pachLocalName, pachPrefix,
* pachUri will be usefull.
+ *
* @param eNODE_TYPE The type of the child to be created, it should be either
* CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
* ComplexElements.
@@ -114,6 +162,7 @@
* @param pachPrefix The prefix of the complex element to be created.
* @param pachUri The namespace uri of the complex element to be created.
* @param pachValue The value of the character element to be created.
+ *
* @return The child node created will be returned if the creation is
* successfull. If the creation is unsccessfull it will return NULL.
*/
@@ -121,7 +170,14 @@
AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri,
AxisChar* pachValue);
- /*
+ /**
+ * Adds a Attribute to this Header Block.
+ *
+ * @param attr The Attribute to be added.
+ */
+ void addAttribute(Attribute* attr);
+
+ /**
* A user can use this method to create a standard HeaderBlock attribute.
* The types of HEADER_BLOCK_STD_ATTR_TYPE are:
* ROLE_NEXT : To create the role attribute to point to next.
@@ -139,6 +195,7 @@
* SOAP_VERSION.
* To use ACTOR, MUST_UNDERSTAND_TRUE, MUST_UNDERSTAND_FALSE the user has
* to pass SOAP_VER_1_1 as the SOAP_VERSION.
+ *
* @param eStdAttrType The standard attribute to be created.
* The current values that can be passes are: ROLE_NEXT, ROLE_NONE,
* ROLE_ULTIMATE_RECEIVER, ACTOR, MUST_UNDERSTAND_TRUE,
@@ -146,20 +203,43 @@
* @param eSOAP_VERSION The related soap version.
* The vallues which could be
* passes are SOAP_VER_1_1 and SOAP_VER_1_2.
+ *
+ * @return A pointer to the created standard Attribute will be returned.
*/
Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType,
SOAP_VERSION eSOAP_VERSION);
+ /**
+ * Creates a Attribute and adds it to this Header Block.
+ *
+ * @param localname The local name of the attribute.
+ * @param prefix The prefix of the attribute.
+ * @param uri The namespace uri of the attribute.
+ * @param value The value of the attribute.
+ *
+ * @return A pointer to the created Attribute will be returned.
+ */
Attribute* createAttribute(const AxisChar* localname,
const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
+
+ /**
+ * Creates a Attribute and adds it to this Header Block.
+ *
+ * @param localname The local name of the attribute.
+ * @param prefix The prefix of the attribute.
+ * @param value The value of the attribute.
+ *
+ * @return A pointer to the created Attribute will be returned.
+ */
Attribute* createAttribute(const AxisChar* localname,
const AxisChar* prefix, const AxisChar* value);
- /*
+ /**
* Creates a child node depending on the given type. If the type is
* CHARACTER_NODE a CharacterElement is created. If the type is
* ELEMENT_NODE a ComplexElement is created. After creating the child it
* will be added as a immediate child to the header block.
+ *
* @param The type of the child to be created, it should be either
* CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
* ComplexElements.
@@ -168,12 +248,13 @@
*/
BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE);
- /*
+ /**
* Creates a child node depending on the given type. If the type is
* CHARACTER_NODE a CharacterElement is created. If the type is
* ELEMENT_NODE a ComplexElement is created. After creating the child it
* will not be added as a child to the header block. The user has to add
* the created child to the appropriate locaion as his wish.
+ *
* @param eNODE_TYPE The type of the child to be created,
* it should be either
* CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
@@ -183,42 +264,106 @@
*/
BasicNode* createChild(NODE_TYPE eNODE_TYPE);
-
-
- /*
+ /**
* Returns the last child element. The user has to check whether the
* method return NULL before proceding.
+ *
* @return The last child element is returned if it exists.
* If the child element doesn't exsist this method returns NULL.
*/
const BasicNode* getLastChild();
- /*
+ /**
* Returns the child element at the given postion.
* The user has to check whether the
* method return NULL before proceding.
+ *
* @param iChildPosition The positon of the required child element.
* @return The required child element is returned if it exists.
* If the child element doesn't exsist this method returns NULL.
*/
const BasicNode* getChild(int iChildPosition);
+
+ /**
+ * Adds a child node to the Header Block.
+ *
+ * @param pBasicNode The child node pointer which is to be added.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
int addChild(BasicNode* pBasicNode);
+ /**
+ * Sets the local name of this Header Block.
+ *
+ * @param localname The localname to set in.
+ */
void setLocalName(const AxisChar* localname);
+
+ /**
+ * Sets the namespace uri of this Header Block.
+ *
+ * @param uri The namespace uri to set in.
+ */
void setUri(const AxisChar* uri);
+
+ /**
+ * Sets the prefix of this Header Block.
+ *
+ * @param prefix The prefix to set in.
+ */
void setPrefix(const AxisChar* prefix);
+ /**
+ * Sets the namespace declaration of the Header Block.
+ *
+ * @param pAttribute The Attribute pointer which points to a valid
+ * namespace declartion Attribute.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
+ int addNamespaceDecl(Attribute *pAttribute);
+
+ /**
+ * The Constructor.
+ *
+ * @param pachLocalName The local name of this Header Block.
+ * @param pachPrefix The prefix of this Header Block.
+ * @param pachUri The namespace uri of this Header Block.
+ */
HeaderBlock(AxisChar* pachLocalName, AxisChar* pachPrefix,
AxisChar* pachUri);
+
+ /**
+ * The Constructor.
+ */
HeaderBlock();
+
+ /**
+ * The Copy Constructor.
+ *
+ * @param rCopy A Header Block.
+ */
HeaderBlock(const HeaderBlock& rCopy);
+
+ /**
+ * Creates and returns a clone of this Header Block.
+ *
+ * @return A clone of this Header Block.
+ */
IHeaderBlock* clone();
+
+ /**
+ * The Destructor.
+ */
virtual ~HeaderBlock();
bool operator ==( const HeaderBlock &objHeaderBlock);
- int addNamespaceDecl(Attribute *pAttribute);
- int serialize(SoapSerializer& pSZ);
- void addAttribute(Attribute* attr);
+
+ int serialize(SoapSerializer& pSZ);
+
+ /**
+ * Initialized the Header Block for testing.
+ */
+ int initializeForTesting();
};
1.11 +179 -4 ws-axis/c/include/axis/server/IHeaderBlock.h
Index: IHeaderBlock.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/IHeaderBlock.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- IHeaderBlock.h 26 May 2004 05:13:14 -0000 1.10
+++ IHeaderBlock.h 13 Jun 2004 14:19:23 -0000 1.11
@@ -34,7 +34,7 @@
* @brief interface for the IHeaderBlock class.
*
*
- * @author Roshan Weerasuriya (roshan@jkcs.slt.lk, roshan@opensource.lk)
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
* @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
*
*/
@@ -44,59 +44,234 @@
* Added copy constructor and clone
*/
+/*
+ * Revision 1.2 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
+
class IHeaderBlock
{
public:
virtual const BasicNode* getFirstChild() =0;
/**
* Returns the number of child elements of this HeaderBlock.
+ *
* @return The number of child elements of this HeaderBlock.
*/
virtual int getNoOfChildren() =0;
+
+ /**
+ * Creates a child node depending on the given node type. i.e:
+ * if node type == CHARACTER_NODE then it creates a Character Element.
+ * if node type == ELEMENT_NODE then it creates a Complex Element.
+ * This method doesn't add the created child to this Header Block. If the
+ * user needs to add this created child then he has to use the
+ * addChild(BasicNode *pBasicNode) method after creating the child.
+ * If the node to be created is a CHARACTER_NODE then only the parameter
+ * pachValue will be usefull and for others you can provide NULL.
+ * If the node to be created is a ELEMENT_NODE then the parameters
+ * pachLocalName, pachPrefix, pachUri will be needed to provide and you
+ * can provide NULL for the pachValue.
+ *
+ * @param eNODE_TYPE The node type to be created, i.e CHARACTER_NODE or
+ * ELEMENT_NODE.
+ * @param pachLocalName The local name of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachPrefix The prefix of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachUri The namespace uri of the child node. A CHARACTER_NODE
+ * will ignore this.
+ * @param pachValue The value of the child node. A ELEMENT_NODE
+ * will ignore this.
+ *
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE,
AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri,
AxisChar* pachValue) = 0;
+
+ /**
+ * Creates a child node depending on the given type. If the type is
+ * CHARACTER_NODE a CharacterElement is created. If the type is
+ * ELEMENT_NODE a ComplexElement is created. After creating the child it
+ * will be added as a immediate child to the header block.
+ * It is important to note that if the type is CHARACTER_NODE only the
+ * NODE_TYPE and value (pachValue) parameters will be usefull.If the type
+ * is ELEMENT_NODE the parameters NODE_TYPE, pachLocalName, pachPrefix,
+ * pachUri will be usefull.
+ *
+ * @param eNODE_TYPE The type of the child to be created, it should be either
+ * CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
+ * ComplexElements.
+ * @param pachLocalName The local name of the complex element to be created.
+ * @param pachPrefix The prefix of the complex element to be created.
+ * @param pachUri The namespace uri of the complex element to be created.
+ * @param pachValue The value of the character element to be created.
+ *
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE,
AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri,
AxisChar* pachValue) = 0;
+
+ /**
+ * A user can use this method to create a standard HeaderBlock attribute.
+ * The types of HEADER_BLOCK_STD_ATTR_TYPE are:
+ * ROLE_NEXT : To create the role attribute to point to next.
+ * ROLE_NONE : To create the role attribute to point to none.
+ * ROLE_ULTIMATE_RECEIVER : To create the role attribute to point to
+ * ultimate receiver.
+ * ACTOR : To create the actor attribute to point to next.
+ * MUST_UNDERSTAND_TRUE : To create the mustUnderstand attribute to
+ * point to true.
+ * MUST_UNDERSTAND_FALSE : To create the mustUnderstand attribute to
+ * point to false.
+ * To use ROLE_NEXT,
+ * ROLE_NONE, ROLE_ULTIMATE_RECEIVER, MUST_UNDERSTAND_TRUE,
+ * MUST_UNDERSTAND_FALSE the user has to pass SOAP_VER_1_2 as the
+ * SOAP_VERSION.
+ * To use ACTOR, MUST_UNDERSTAND_TRUE, MUST_UNDERSTAND_FALSE the user has
+ * to pass SOAP_VER_1_1 as the SOAP_VERSION.
+ *
+ * @param eStdAttrType The standard attribute to be created.
+ * The current values that can be passes are: ROLE_NEXT, ROLE_NONE,
+ * ROLE_ULTIMATE_RECEIVER, ACTOR, MUST_UNDERSTAND_TRUE,
+ * MUST_UNDERSTAND_FALSE.
+ * @param eSOAP_VERSION The related soap version.
+ * The vallues which could be
+ * passes are SOAP_VER_1_1 and SOAP_VER_1_2.
+ *
+ * @return A pointer to the created standard Attribute will be returned.
+ */
virtual Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE
eStdAttrType, SOAP_VERSION eSOAP_VERSION) =0;
+
+ /**
+ * Creates a Attribute and adds it to this Header Block.
+ *
+ * @param localname The local name of the attribute.
+ * @param prefix The prefix of the attribute.
+ * @param uri The namespace uri of the attribute.
+ * @param value The value of the attribute.
+ *
+ * @return A pointer to the created Attribute will be returned.
+ */
virtual Attribute* createAttribute(const AxisChar* localname,
const AxisChar* prefix,
const AxisChar* uri, const AxisChar* value) = 0;
+
+ /**
+ * Creates a Attribute and adds it to this Header Block.
+ *
+ * @param localname The local name of the attribute.
+ * @param prefix The prefix of the attribute.
+ * @param value The value of the attribute.
+ *
+ * @return A pointer to the created Attribute will be returned.
+ */
virtual Attribute* createAttribute(const AxisChar *localname,
const AxisChar *prefix, const AxisChar *value) = 0;
+ /**
+ * Creates a child node depending on the given type. If the type is
+ * CHARACTER_NODE a CharacterElement is created. If the type is
+ * ELEMENT_NODE a ComplexElement is created. After creating the child it
+ * will be added as a immediate child to the header block.
+ *
+ * @param The type of the child to be created, it should be either
+ * CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
+ * ComplexElements.
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE) = 0;
+
+ /**
+ * Creates a child node depending on the given type. If the type is
+ * CHARACTER_NODE a CharacterElement is created. If the type is
+ * ELEMENT_NODE a ComplexElement is created. After creating the child it
+ * will not be added as a child to the header block. The user has to add
+ * the created child to the appropriate locaion as his wish.
+ *
+ * @param eNODE_TYPE The type of the child to be created,
+ * it should be either
+ * CHARACTER_NODE for CharacterElements or ELEMENT_NODE for
+ * ComplexElements.
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE)=0;
/**
* Returns the last child element. The user has to check whether the
* method return NULL before proceding.
+ *
* @return The last child element is returned if it exists.
- * If the child element
- * doesn't exsist this method returns NULL.
+ * If the child element doesn't exsist this method returns NULL.
*/
virtual const BasicNode* getLastChild() = 0;
/**
* Returns the child element at the given postion.
* The user has to check whether the method return NULL before proceding.
+ *
* @param iChildPosition The positon of the required child element.
* @return The required child element is returned if it exists.
* If the child element doesn't exsist this method returns NULL.
*/
virtual const BasicNode* getChild(int iChildPosition) = 0;
+ /**
+ * Adds a child node to the Header Block.
+ *
+ * @param pBasicNode The child node pointer which is to be added.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
virtual int addChild(BasicNode* pBasicNode)=0;
+
+ /**
+ * Sets the local name of this Header Block.
+ *
+ * @param localname The localname to set in.
+ */
virtual void setLocalName(const AxisChar* localname)=0;
+
+ /**
+ * Sets the namespace uri of this Header Block.
+ *
+ * @param uri The namespace uri to set in.
+ */
virtual void setUri(const AxisChar* uri)=0;
+
+ /**
+ * Sets the prefix of this Header Block.
+ *
+ * @param prefix The prefix to set in.
+ */
virtual void setPrefix(const AxisChar* prefix)=0;
- virtual int initializeForTesting() = 0;
+
IHeaderBlock(){/*empty body as there are no member variable*/};
+
IHeaderBlock(const IHeaderBlock& rCopy){/*empty body as there are no member variable*/};
+
+ /**
+ * Creates and returns a clone of this Header Block.
+ *
+ * @return A clone of this Header Block.
+ */
virtual IHeaderBlock* clone() = 0;
+
+ /**
+ * The Destructor.
+ */
virtual ~IHeaderBlock() {};
+
+ /**
+ * Initialized the Header Block for testing.
+ */
+ virtual int initializeForTesting() = 0;
};
#endif
1.9 +54 -6 ws-axis/c/include/axis/server/SoapHeader.h
Index: SoapHeader.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapHeader.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SoapHeader.h 7 May 2004 08:27:30 -0000 1.8
+++ SoapHeader.h 13 Jun 2004 14:19:23 -0000 1.9
@@ -39,9 +39,14 @@
* a SOAP header block.
*
*
- * @author Roshan Weerasuriya (roshan@jkcs.slt.lk, roshan@opensource.lk)
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
*/
+/*
+ * Revision 1.1 2004/06/13 roshan
+ * Added doxygen comments to help autobuild API docs
+ */
+
typedef enum
{
HEADER_LEVEL=0, HEADER_BLOCK_LEVEL, HEADER_BLOCK_INSIDE_LEVEL
@@ -51,32 +56,75 @@
{
private:
int serializeNamespaceDecl(SoapSerializer& pSZ);
- /* int serializeNamespaceDecl(string&); */
+
int serializeAttributes(SoapSerializer& pSZ);
- /* int serializeAttributes(string&); */
+
list<Attribute*> m_attributes;
list<Attribute*> m_namespaceDecls;
list<HeaderBlock*> m_headerBlocks;
- /* string m_strHeaderSerialized; */
+
const char* m_pcPrefix;
public:
+ /**
+ * Gets and returns the Header Block, of the given name.
+ *
+ * @param pName The local name of the requested Header Block.
+ * @param pNamespace The namespace uri of the requested Header Block.
+ * @return A pointer to the requested Header Block will be returned if
+ * found or else if not found a NULL pointer will be retured. In case of
+ * the requested Header Block is found, also it will be removed from the
+ * list of Header Blocks of this Soap Header, before returning a pointer.
+ */
IHeaderBlock* getHeaderBlock(const AxisChar* pName,
const AxisChar* pNamespace);
+
+ /**
+ * Sets the Prefix of the Header Block.
+ *
+ * @param pcPrefix The prefix to set.
+ */
int setPrefix(const char* pcPrefix);
+
/**
* Removes the next HeaderBlock from the list and returns it.
* But will not delete it.
* @return The removed HeaderBlock of the list.
*/
IHeaderBlock* getHeaderBlock();
+
+ /**
+ * Sets the namespace declaration of the Soap Header.
+ *
+ * @param pAttribute The Attribute pointer which points to a valid
+ * namespace declartion Attribute.
+ * @return AXIS_SUCCESS to indicate successfull operation.
+ */
int addNamespaceDecl(Attribute* pAttribute);
+
+ /**
+ * Adds a Attribute to this Soap Header.
+ *
+ * @param attr The Attribute to be added.
+ */
int addAttribute(Attribute* pAttribute);
- /* string& serialize(); */
+
int serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion);
- /* int serialize(string&, SOAP_VERSION eSoapVersion); */
+
+ /**
+ * Adds a Header Block to this Soap Header.
+ *
+ * @param headerBlock The Header Block to be added.
+ */
void addHeaderBlock(HeaderBlock* headerBlock);
+ /**
+ * The Constructor.
+ */
SoapHeader();
+
+ /**
+ * The Destructor.
+ */
virtual ~SoapHeader();
};