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/02/28 07:27:57 UTC
cvs commit: ws-axis/c/vc/server/apache1_3 Apache1_3.dsp
roshan 2004/02/27 22:27:56
Modified: c/include/axis/client Call.h
c/include/axis/common MessageData.h IMessageData.h
IHeaderBlock.h
c/src/client Call.cpp
c/include/axis/soap Attribute.h BasicNode.h
CharacterElement.h ComplexElement.h HeaderBlock.h
SoapBody.h SoapEnvVersions.h SoapEnvelope.h
SoapMethod.h SoapSerializer.h
c/src/common MessageData.cpp
c/src/soap Attribute.cpp CharacterElement.cpp
ComplexElement.cpp HeaderBlock.cpp SoapBody.cpp
SoapDeSerializer.cpp SoapEnvelope.cpp
SoapHeader.cpp SoapMethod.cpp SoapSerializer.cpp
c/vc/server/apache1_3 Apache1_3.dsp
Log:
Api improvements for Header processing/ Handlers. Included methods to improve the handler wirting/ header processing process
Revision Changes Path
1.10 +1 -0 ws-axis/c/include/axis/client/Call.h
Index: Call.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/client/Call.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Call.h 10 Feb 2004 12:19:58 -0000 1.9
+++ Call.h 28 Feb 2004 06:27:55 -0000 1.10
@@ -466,6 +466,7 @@
int AXISCALL SetEndpointURI(const char* pchEndpointURI);
Call();
public:
+ IHeaderBlock* createHeaderBlock(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri);
IHeaderBlock* createHeaderBlock();
int SetSoapHeader(SoapHeader *pSoapHeader);
/* Methods used by stubs to get a deserialized value of XML element as basic types */
1.4 +13 -4 ws-axis/c/include/axis/common/MessageData.h
Index: MessageData.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/common/MessageData.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MessageData.h 14 Jan 2004 12:57:09 -0000 1.3
+++ MessageData.h 28 Feb 2004 06:27:56 -0000 1.4
@@ -83,6 +83,15 @@
@author Susantha Kumara (skumara@virtusa.com)
*/
+
+struct ltstr
+{
+ bool operator()(const char* s1, const char* s2) const
+ {
+ return strcmp(s1, s2) < 0;
+ }
+};
+
class MessageData : public IMessageData
{
public:
@@ -92,8 +101,8 @@
SoapSerializer* m_pSZ;
SoapDeSerializer* m_pDZ;
public:
- string& getProperty(string& sName);
- int setProperty(string& sName, string& sValue);
+ const AxisChar* getProperty(AxisChar* pachName);
+ int setProperty(AxisChar* pachName, const AxisChar* pachValue);
void SetOperationName(const AxisChar* pchOperation){m_sOperationName = pchOperation;};
void getSoapDeSerializer(IHandlerSoapDeSerializer** pIHandlerSoapDeSerializer);
const AxisChar* AXISCALL GetOperationName(){return m_sOperationName.c_str();};
@@ -119,8 +128,8 @@
private:
void getWSDDDeployment(IDeployerUtils** pIDeployerUtils);
bool m_bPastPivotState;
- map <string, string> m_Properties;
- static string m_sBlankPropertyValue;
+ map <AxisChar*, AxisChar*, ltstr> m_Properties;
+ static const AxisChar* m_pachBlankPropertyValue;
};
#endif // !defined(AFX_MESSAGEDATA_H__8B839E07_3D23_46C6_8743_543B4917D202__INCLUDED_)
1.8 +2 -2 ws-axis/c/include/axis/common/IMessageData.h
Index: IMessageData.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/common/IMessageData.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- IMessageData.h 3 Feb 2004 13:04:45 -0000 1.7
+++ IMessageData.h 28 Feb 2004 06:27:56 -0000 1.8
@@ -107,8 +107,8 @@
private:
virtual void getWSDDDeployment(IDeployerUtils** pIDeployerUtils) = 0;
public:
- virtual int setProperty(string& sName, string& sValue)=0;
- virtual string& getProperty(string& sName)=0;
+ virtual int setProperty(AxisChar* pachName, const AxisChar* pachValue)=0;
+ virtual const AxisChar* getProperty(AxisChar* sName)=0;
virtual const AxisChar* AXISCALL GetOperationName()=0;
virtual void AXISCALL GetSoapSerializer(IWrapperSoapSerializer** pIWSS)=0;
virtual void AXISCALL GetSoapDeSerializer(IWrapperSoapDeSerializer** pIWSDS)=0;
1.5 +40 -5 ws-axis/c/include/axis/common/IHeaderBlock.h
Index: IHeaderBlock.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/common/IHeaderBlock.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- IHeaderBlock.h 3 Feb 2004 13:04:45 -0000 1.4
+++ IHeaderBlock.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -65,6 +65,14 @@
#define AFX_IHEADERBLOCK_H__1FFF90C8_3E12_4EFD_8D97_61E2E92A0BB7__INCLUDED_
#include "../soap/BasicNode.h"
+#include "../soap/SoapEnvVersions.h"
+#include "../soap/Attribute.h"
+
+enum HEADER_BLOCK_STD_ATTR_TYPE { ROLE_NEXT=1, ROLE_NONE=2,
+ ROLE_ULTIMATE_RECEIVER=3, ACTOR=4, MUST_UNDERSTAND_TRUE= 5,
+ MUST_UNDERSTAND_FALSE=6};
+
+
/**
@class IHeaderBlock
@brief interface for the IHeaderBlock class.
@@ -75,16 +83,43 @@
class IHeaderBlock
{
public:
-#ifdef UNIT_TESTING_BUILD
- virtual int initializeForTesting() = 0;
-#endif
+ virtual 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;
+ virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue) = 0;
+ virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue) = 0;
+ virtual Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, SOAP_VERSION eSOAP_VERSION) =0;
+ virtual Attribute* createAttribute(const AxisChar* localname, const AxisChar* prefix, const AxisChar* uri, const AxisChar* value) = 0;
+ virtual Attribute* createAttribute(const AxisChar *localname, const AxisChar *prefix, const AxisChar *value) = 0;
+
+ virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE) = 0;
virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE)=0;
- virtual BasicNode* getFirstChild()=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.
+ */
+ virtual 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 BasicNode* getChild(int iChildPosition) = 0;
+
virtual int addChild(BasicNode* pBasicNode)=0;
virtual void setLocalName(const AxisChar* localname)=0;
virtual void setUri(const AxisChar* uri)=0;
virtual void setPrefix(const AxisChar* prefix)=0;
- virtual void setValue(const AxisChar* value)=0;
+ virtual int initializeForTesting() = 0;
virtual ~IHeaderBlock() {};
};
1.29 +5 -0 ws-axis/c/src/client/Call.cpp
Index: Call.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/client/Call.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Call.cpp 11 Feb 2004 10:44:25 -0000 1.28
+++ Call.cpp 28 Feb 2004 06:27:56 -0000 1.29
@@ -482,3 +482,8 @@
{
return (m_pIWSSZ->createHeaderBlock());
}
+
+IHeaderBlock* Call::createHeaderBlock(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri)
+{
+ return (m_pIWSSZ->createHeaderBlock(pachLocalName, pachPrefix, pachUri));
+}
1.5 +4 -5 ws-axis/c/include/axis/soap/Attribute.h
Index: Attribute.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/Attribute.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Attribute.h 3 Feb 2004 13:04:45 -0000 1.4
+++ Attribute.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -78,7 +78,7 @@
- @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
+ @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcs.slt.lk)
*/
class Attribute
{
@@ -88,16 +88,15 @@
AxisString m_prefix;
AxisString m_uri;
AxisString m_value;
- //string m_strAttrSerialized;
+
public:
-#ifdef UNIT_TESTING_BUILD
int initializeForTesting();
-#endif
int serialize(SoapSerializer& pSZ) const;
int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
- //int serialize(string&);
+
Attribute();
Attribute(const AxisChar* localname, const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
+ Attribute(const AxisChar* localname, const AxisChar* prefix, const AxisChar* value);
virtual ~Attribute();
void setValue(const AxisChar* value);
1.4 +18 -4 ws-axis/c/include/axis/soap/BasicNode.h
Index: BasicNode.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/BasicNode.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BasicNode.h 3 Feb 2004 04:45:53 -0000 1.3
+++ BasicNode.h 28 Feb 2004 06:27:56 -0000 1.4
@@ -87,18 +87,32 @@
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.
+ */
+ virtual int getNoOfChildren() = 0;
+ virtual BasicNode* getFirstChild() = 0;
+ virtual BasicNode* getLastChild() = 0;
+ virtual BasicNode* getChild(int iChildPosition) = 0;
//virtual bool operator ==( const BasicNode &objChEle)=0;
- virtual const AxisString& getValue()=0;
- virtual int setValue(const AxisChar* sValue)=0;
+ virtual const AxisChar* getValue()=0;
+ virtual int setValue(const AxisChar* pachValue)=0;
virtual NODE_TYPE getNodeType()=0;
+ virtual int setURI(const AxisChar* sURI) =0;
+ virtual int addChild(BasicNode* pBasicNode) =0;
+ virtual int setLocalName(const AxisChar* sLocalName) =0;
+ virtual int setPrefix(const AxisChar* sPrefix) =0;
virtual int serialize(SoapSerializer& pSZ) =0;
virtual int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack) =0;
virtual ~BasicNode() {};
protected:
NODE_TYPE m_iNodeType;
- string m_sPrefix;
- AxisString m_sValue;
+ //string m_sPrefix;
+ AxisChar* m_pachValue;
};
#endif // !defined(AFX_BASICNODE_H__623900B8_2737_4E36_8F26_97898C5BD47D__INCLUDED_)
1.5 +67 -2 ws-axis/c/include/axis/soap/CharacterElement.h
Index: CharacterElement.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/CharacterElement.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CharacterElement.h 3 Feb 2004 04:45:53 -0000 1.4
+++ CharacterElement.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -80,8 +80,73 @@
{
public:
bool operator ==( const CharacterElement &objChEle);
- int setValue(const AxisChar* sValue);
- const AxisString& getValue();
+ int setValue(const AxisChar* pachValue);
+ const AxisChar* getValue();
+
+ /**
+ * 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.
+ */
+ BasicNode* getFirstChild() {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.
+ */
+ BasicNode* getLastChild() {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.
+ */
+ BasicNode* getChild(int iChildPosition) {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.
+ */
+ 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.
+ */
+ 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.
+ */
+ 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.
+ */
+ 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
1.5 +42 -12 ws-axis/c/include/axis/soap/ComplexElement.h
Index: ComplexElement.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/ComplexElement.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ComplexElement.h 3 Feb 2004 04:45:53 -0000 1.4
+++ ComplexElement.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -68,7 +68,6 @@
#pragma warning (disable : 4786)
#endif
-#include <string>
#include <list>
#include "BasicNode.h"
@@ -83,27 +82,58 @@
class ComplexElement : public BasicNode
{
public:
- int setValue(const AxisChar* sValue);
- const AxisString& getValue();
+ ComplexElement(AxisChar* pachLocalName, AxisChar* pachPrefix, AxisChar* pachUri);
+ /**
+ * Returns the number of child elements of this ComplexElement.
+ * @return The number of child elements of this ComplexElement.
+ */
+ int getNoOfChildren();
+ BasicNode* getChild(int iChildPosition);
+ BasicNode* getLastChild();
+ BasicNode* getFirstChild();
NODE_TYPE getNodeType();
- int setURI(const AxisChar* sURI);
+ int setURI(const AxisChar* pachURI);
+ int addChild(BasicNode* pBasicNode);
+ int setLocalName(const AxisChar* pachLocalName);
+ int setPrefix(const AxisChar* pachPrefix);
int serialize(SoapSerializer& pSZ);
int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
- int addChild(BasicNode* pBasicNode);
- int setLocalName(const AxisChar* sLocalName);
- int setPrefix(const AxisChar* sPrefix);
ComplexElement();
virtual ~ComplexElement();
-private:
+ /**
+ * This method is overridden to do nothing always because this is
+ * a Complex Element. Instead of using this method, a user of a
+ * ComplexElement must get the childeren of this ComplexElement and
+ * has to traverse through the childrean in a appropriate manner
+ * in order to set there values.
+ * A user of a ComplexElement should not use this method.
+ * @param
+ * @return Always return fail (AXIS_FAIL).
+ */
+ int setValue(const AxisChar* pachValue) {return AXIS_FAIL;}
+
+ /**
+ * This method is overridden to return NULL always because this is
+ * a Complex Element. Instead of using this method, a user of a
+ * ComplexElement must get the childeren of this ComplexElement and
+ * has to traverse through the childrean in a appropriate manner
+ * in order to get there values.
+ * A user of a ComplexElement should not use this method.
+ * @param
+ * @return Always return NULL to indicate unsuccessful.
+ */
+ const AxisChar* getValue() {return NULL;}
+
+private:
+ int iNoOfChildren;
int serializeChildren(SoapSerializer& pSZ);
int serializeChildren(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
- //int serializeChildren(string& sSerialized);
bool isSerializable();
list<BasicNode*> m_children;
- AxisString m_sPrefix;
- AxisString m_sLocalName;
- AxisString m_sURI;
+ AxisChar* m_pachPrefix;
+ AxisChar* m_pachLocalName;
+ AxisChar* m_pachURI;
};
#endif // !defined(AFX_COMPLEXELEMENT_H__558543B0_B076_404C_A7FE_830E13C1785A__INCLUDED_)
1.6 +115 -18 ws-axis/c/include/axis/soap/HeaderBlock.h
Index: HeaderBlock.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/HeaderBlock.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HeaderBlock.h 13 Feb 2004 07:42:44 -0000 1.5
+++ HeaderBlock.h 28 Feb 2004 06:27:56 -0000 1.6
@@ -72,6 +72,7 @@
class BasicNode;
#include "../common/IHeaderBlock.h"
+#include "../soap/SoapEnvVersions.h"
/**
@class BasicNode
@@ -106,43 +107,139 @@
friend class SoapHeader;
private:
+ /**
+ * Returns the number of child elements of this HeaderBlock.
+ * @return The number of child elements of this HeaderBlock.
+ */
+ int iNoOFChildren;
+
int serializeNamespaceDecl(SoapSerializer& pSZ);
int serializeChildren(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
- //int serializeChildren(string& sSerialized);
list<BasicNode*> m_children;
- bool isSerializable();
+ bool isSerializable();
int attrSerialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
- //int attrSerialize(string&);
AxisString m_localname;
AxisString m_prefix;
AxisString m_uri;
list<Attribute*> m_attributes;
list<Attribute*> m_namespaceDecls;
- /* I think that now this member varialble is not needed, i.e m_value roshan
- AxisString m_value;
- */
-
-
public:
- bool operator ==( const HeaderBlock &objHeaderBlock);
-#ifdef UNIT_TESTING_BUILD
+ BasicNode* getFirstChild();
+ int getNoOfChildren();
+ BasicNode* createChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue);
+
int initializeForTesting();
-#endif
+
+ /**
+ * 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.
+ */
+ BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue);
+
+ /**
+ * 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.
+ */
+ Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, SOAP_VERSION eSOAP_VERSION);
+
+ Attribute* createAttribute(const AxisChar* localname, const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
+ 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.
+ * @return The child node created will be returned if the creation is
+ * successfull. If the creation is unsccessfull it will return NULL.
+ */
+ 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
+ * ComplexElements.
+ * @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);
- BasicNode* getFirstChild();
- int addNamespaceDecl(Attribute *pAttribute);
+
+
+
+ /**
+ * 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.
+ */
+ 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.
+ */
+ BasicNode* getChild(int iChildPosition);
int addChild(BasicNode* pBasicNode);
- int serialize(SoapSerializer& pSZ);
- //int serialize(string&);
- void setValue(const AxisChar* value);
- void addAttribute(Attribute* attr);
+ void setLocalName(const AxisChar* localname);
void setUri(const AxisChar* uri);
void setPrefix(const AxisChar* prefix);
- void setLocalName(const AxisChar* localname);
+
+ HeaderBlock(AxisChar* pachLocalName, AxisChar* pachPrefix, AxisChar* pachUri);
HeaderBlock();
virtual ~HeaderBlock();
+
+ bool operator ==( const HeaderBlock &objHeaderBlock);
+ int addNamespaceDecl(Attribute *pAttribute);
+ int serialize(SoapSerializer& pSZ);
+ void addAttribute(Attribute* attr);
};
1.5 +2 -2 ws-axis/c/include/axis/soap/SoapBody.h
Index: SoapBody.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapBody.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapBody.h 3 Feb 2004 13:04:45 -0000 1.4
+++ SoapBody.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -117,9 +117,9 @@
//string m_strBodySerialized;
public:
-#ifdef UNIT_TESTING_BUILD
+
int initializeForTesting();
-#endif
+
void addAttribute(Attribute* attr);
//string& serialize();
int serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion);
1.4 +1 -1 ws-axis/c/include/axis/soap/SoapEnvVersions.h
Index: SoapEnvVersions.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapEnvVersions.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SoapEnvVersions.h 14 Jan 2004 12:57:10 -0000 1.3
+++ SoapEnvVersions.h 28 Feb 2004 06:27:56 -0000 1.4
@@ -57,7 +57,7 @@
*
*/
/**
- * @author Roshan Weerasuriya (roshan@jkcs.slt.lk)
+ * @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcs.slt.lk)
*
*/
1.5 +1 -2 ws-axis/c/include/axis/soap/SoapEnvelope.h
Index: SoapEnvelope.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapEnvelope.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapEnvelope.h 3 Feb 2004 13:04:45 -0000 1.4
+++ SoapEnvelope.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -94,9 +94,8 @@
AxisString m_sPrefix;
public:
-#ifdef UNIT_TESTING_BUILD
+
int initializeForTesting(SOAP_VERSION eSoapVersion);
-#endif
int setPrefix(const AxisChar* prefix);
int addNamespaceDecl(Attribute* pAttribute);
int addAttribute(Attribute* pAttribute);
1.5 +2 -2 ws-axis/c/include/axis/soap/SoapMethod.h
Index: SoapMethod.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapMethod.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapMethod.h 3 Feb 2004 13:04:45 -0000 1.4
+++ SoapMethod.h 28 Feb 2004 06:27:56 -0000 1.5
@@ -118,9 +118,9 @@
* Initializes the member variables for testing.
* @return The status indicating success (AXIS_SUCCESS) or failure (AXIS_FAIL).
*/
-#ifdef UNIT_TESTING_BUILD
+
int initializeForTesting();
-#endif
+
int reset();
int addAttribute(Attribute* pAttribute);
const AxisChar* getMethodName();
1.9 +3 -2 ws-axis/c/include/axis/soap/SoapSerializer.h
Index: SoapSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapSerializer.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SoapSerializer.h 3 Feb 2004 13:04:45 -0000 1.8
+++ SoapSerializer.h 28 Feb 2004 06:27:56 -0000 1.9
@@ -121,9 +121,9 @@
/* Provider type of current service that uses this Serializer object */
PROVIDERTYPE m_ProviderType;
public:
-#ifdef UNIT_TESTING_BUILD
+
int setOutputStreamForTesting(const Ax_soapstream* pStream);
-#endif
+
int AXISCALL CreateSoapMethod(const AxisChar* sLocalName, const AxisChar* sURI);
// IWrapperSoapSerializer& operator<<(const char* cSerialized);
@@ -185,6 +185,7 @@
BasicTypeSerializer m_BTSZ;
const Ax_soapstream* m_pOutputStream;
public:
+ IHeaderBlock* createHeaderBlock(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri);
/* to add a header block to the Serializer. Probably by a handler */
int AXISCALL AddHeaderBlock(IHeaderBlock* pBlk);
int AXISCALL AddOutputParam(const AxisChar* pchName, void* pValue, XSDTYPE type);
1.17 +24 -11 ws-axis/c/src/common/MessageData.cpp
Index: MessageData.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/common/MessageData.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- MessageData.cpp 3 Feb 2004 13:04:47 -0000 1.16
+++ MessageData.cpp 28 Feb 2004 06:27:56 -0000 1.17
@@ -72,7 +72,7 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-string MessageData::m_sBlankPropertyValue="";
+const AxisChar* MessageData::m_pachBlankPropertyValue = "";
extern WSDDDeployment* g_pWSDDDeployment;
IMessageDataFunctions IMessageData::ms_VFtable;
@@ -85,7 +85,16 @@
MessageData::~MessageData()
{
- //nothing to do
+ map <AxisChar*, AxisChar*, ltstr>::iterator itCurrentItem= m_Properties.begin();
+
+ while (itCurrentItem != m_Properties.end()) {
+ free((*itCurrentItem).first);
+ free((*itCurrentItem).second);
+
+ itCurrentItem++;
+ }
+
+ m_Properties.clear();
}
void MessageData::SetSerializer(SoapSerializer *pSZ)
@@ -164,9 +173,15 @@
*pIHandlerSoapDeSerializer= static_cast<IHandlerSoapDeSerializer*>(m_pDZ);
}
-int MessageData::setProperty(string &sName, string &sValue)
+int MessageData::setProperty(AxisChar* pachName, const AxisChar* pachValue)
{
- m_Properties[sName.c_str()]= sValue;
+ AxisChar* pachTmpName = (AxisChar*) malloc(strlen(pachName)+1);
+ strcpy(pachTmpName, pachName);
+ AxisChar* pachTmpValue = (AxisChar*) malloc(strlen(pachValue)+1);
+ strcpy(pachTmpValue, pachValue);
+
+ m_Properties[pachTmpName]= pachTmpValue;
+
return AXIS_SUCCESS;
}
@@ -175,16 +190,14 @@
* not. If it is empty then the idea is that the property is not
* available.
*/
-string& MessageData::getProperty(string &sName)
-{
-
- if (m_Properties.find(sName) != m_Properties.end())
+const AxisChar* MessageData::getProperty(AxisChar* pachName)
+{
+ if (m_Properties.find(pachName) != m_Properties.end())
{
- return m_Properties[sName];
+ return m_Properties[pachName];
}
-
- return m_sBlankPropertyValue;
+ return m_pachBlankPropertyValue;
}
void MessageData::getWSDDDeployment(IDeployerUtils **pIDeployerUtils)
1.12 +10 -25 ws-axis/c/src/soap/Attribute.cpp
Index: Attribute.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Attribute.cpp 3 Feb 2004 13:04:47 -0000 1.11
+++ Attribute.cpp 28 Feb 2004 06:27:56 -0000 1.12
@@ -144,6 +144,9 @@
if (isSerializable()) {
pSZ.Serialize(" ", NULL);
+ /*
+ *Following code figures out the prefix to be serialized and serialize it.
+ */
if(!m_prefix.empty()) {
pSZ.Serialize(m_prefix.c_str(), ":", NULL);
} else if (!m_uri.empty()) {
@@ -164,29 +167,6 @@
return intStatus;
}
-/*
-commented on 10Jul2003 3.30 pm
-int Attribute::serialize(string& sSerialized)
-{
- int intStatus= AXIS_FAIL;
-
- if (isSerializable()) {
- sSerialized+= " ";
-
- if(!m_prefix.empty()) {
- sSerialized= sSerialized+ m_prefix+ ":";
- }
-
- sSerialized= sSerialized + m_localname +
- "=\""+ m_value+ "\"";
-
- intStatus= AXIS_SUCCESS;
- }
-
- return intStatus;
-}
-*/
-
bool Attribute::isSerializable() const
{
bool bStatus= true;
@@ -198,7 +178,6 @@
return bStatus;
}
-#ifdef UNIT_TESTING_BUILD
int Attribute::initializeForTesting()
{
m_prefix = "pr";
@@ -208,5 +187,11 @@
return AXIS_SUCCESS;
}
-#endif
+
+Attribute::Attribute(const AxisChar *localname, const AxisChar *prefix, const AxisChar *value)
+{
+ m_localname= localname;
+ m_prefix= prefix;
+ m_value= value;
+}
1.9 +17 -25 ws-axis/c/src/soap/CharacterElement.cpp
Index: CharacterElement.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/CharacterElement.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- CharacterElement.cpp 3 Feb 2004 05:19:51 -0000 1.8
+++ CharacterElement.cpp 28 Feb 2004 06:27:56 -0000 1.9
@@ -76,17 +76,19 @@
CharacterElement::CharacterElement()
{
m_iNodeType= CHARACTER_NODE;
+ m_pachValue = '\0';
}
-CharacterElement::CharacterElement(const AxisChar* sValue)
+CharacterElement::CharacterElement(const AxisChar* pachValue)
{
- m_sValue= sValue;
+ m_pachValue = (AxisChar*) malloc(strlen(pachValue)+1);
+ strcpy(m_pachValue, pachValue);
m_iNodeType= CHARACTER_NODE;
}
CharacterElement::~CharacterElement()
{
-
+ free(m_pachValue);
}
NODE_TYPE CharacterElement::getNodeType()
@@ -96,40 +98,30 @@
int CharacterElement::serialize(SoapSerializer& pSZ)
{
-
- //the serialization code should come here
- pSZ.Serialize(m_sValue.c_str(), NULL);
-
- return AXIS_SUCCESS;
-}
-
-/*
-comm on 10/7/2003 6.10pm
-int CharacterElement::serialize(string &sSerialized)
-{
-
- //the serialization code should come here
- sSerialized+= m_sValue;
-
- return AXIS_SUCCESS;
+ if (m_pachValue != NULL) {
+ pSZ.Serialize(m_pachValue, NULL);
+ return AXIS_SUCCESS;
+ } else {
+ return AXIS_FAIL;
+ }
}
-*/
-const AxisString& CharacterElement::getValue()
+const AxisChar* CharacterElement::getValue()
{
- return m_sValue;
+ return m_pachValue;
}
-int CharacterElement::setValue(const AxisChar* sValue)
+int CharacterElement::setValue(const AxisChar* pachValue)
{
- m_sValue= sValue;
+ m_pachValue = (AxisChar*) malloc(strlen(pachValue)+1);
+ strcpy(m_pachValue, pachValue);
return AXIS_SUCCESS;
}
bool CharacterElement::operator ==( const CharacterElement &objChEle)
{
- if (objChEle.m_sValue == m_sValue) {
+ if (strcmp(objChEle.m_pachValue , m_pachValue) == 0) {
return true;
}
else {
1.9 +105 -105 ws-axis/c/src/soap/ComplexElement.cpp
Index: ComplexElement.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ComplexElement.cpp 3 Feb 2004 05:19:10 -0000 1.8
+++ ComplexElement.cpp 28 Feb 2004 06:27:56 -0000 1.9
@@ -75,29 +75,60 @@
ComplexElement::ComplexElement()
{
+ m_pachPrefix = '\0';
+ m_pachLocalName = '\0';
+ m_pachURI = '\0';
+
m_iNodeType= ELEMENT_NODE;
+ iNoOfChildren = 0;
+}
+
+ComplexElement::ComplexElement(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri)
+{
+ m_pachLocalName = (AxisChar*) malloc(strlen(pachLocalName)+1);
+ strcpy(m_pachLocalName, pachLocalName);
+ m_pachPrefix = (AxisChar*) malloc(strlen(pachPrefix)+1);
+ strcpy(m_pachPrefix, pachPrefix);
+ m_pachURI = (AxisChar*) malloc(strlen(pachUri)+1);
+ strcpy(m_pachURI, pachUri);
}
+
ComplexElement::~ComplexElement()
{
+ free(m_pachPrefix);
+ free(m_pachLocalName);
+ free(m_pachURI);
+ /*
+ *Clear the children
+ */
+ list<BasicNode*>::iterator itCurrChild= m_children.begin();
+ while(itCurrChild != m_children.end()) {
+ delete (*itCurrChild);
+ itCurrChild++;
+ }
+ m_children.clear();
}
-int ComplexElement::setPrefix(const AxisChar* sPrefix)
+int ComplexElement::setPrefix(const AxisChar* pachPrefix)
{
- m_sPrefix= sPrefix;
+ m_pachPrefix = (AxisChar*) malloc(strlen(pachPrefix)+1);
+ strcpy(m_pachPrefix, pachPrefix);
return AXIS_SUCCESS;
}
-int ComplexElement::setLocalName(const AxisChar* sLocalName)
+int ComplexElement::setLocalName(const AxisChar* pachLocalName)
{
- m_sLocalName= sLocalName;
+ m_pachLocalName = (AxisChar*) malloc(strlen(pachLocalName)+1);
+ strcpy(m_pachLocalName, pachLocalName);
return AXIS_SUCCESS;
}
int ComplexElement::addChild(BasicNode *pBasicNode)
{
m_children.push_back(pBasicNode);
+ iNoOfChildren++;
return AXIS_SUCCESS;
}
@@ -108,12 +139,12 @@
if(isSerializable())
{
pSZ.Serialize("<", NULL);
- if(m_sPrefix.length() != 0) {
- pSZ.Serialize(m_sPrefix.c_str(), ":", NULL);
+ if(strlen(m_pachPrefix) != 0) {
+ pSZ.Serialize(m_pachPrefix, ":", NULL);
}
- pSZ.Serialize(m_sLocalName.c_str(), NULL);
- if((m_sPrefix.length() != 0) && (m_sURI.length() != 0)) {
- pSZ.Serialize(" xmlns:", m_sPrefix.c_str(), "=\"", m_sURI.c_str(), "\"", NULL);
+ pSZ.Serialize(m_pachLocalName, NULL);
+ if((strlen(m_pachPrefix) != 0) && (strlen(m_pachURI) != 0)) {
+ pSZ.Serialize(" xmlns:", m_pachPrefix, "=\"", m_pachURI, "\"", NULL);
}
pSZ.Serialize(">", NULL);
iStatus= serializeChildren(pSZ);
@@ -121,10 +152,10 @@
break;
}
pSZ.Serialize("</", NULL);
- if(m_sPrefix.length() != 0) {
- pSZ.Serialize(m_sPrefix.c_str(), ":", NULL);
+ if(strlen(m_pachPrefix) != 0) {
+ pSZ.Serialize(m_pachPrefix, ":", NULL);
}
- pSZ.Serialize(m_sLocalName.c_str(), ">", NULL);
+ pSZ.Serialize(m_pachLocalName, ">", NULL);
iStatus= AXIS_SUCCESS;
}
else
@@ -144,20 +175,25 @@
bool blnIsNewNamespace = false;
pSZ.Serialize("<", NULL);
- if(m_sPrefix.length() != 0) {
- pSZ.Serialize(m_sPrefix.c_str(), ":", NULL);
- } else if (m_sURI.length() != 0) {
- m_sPrefix = pSZ.GetNamespacePrefix(m_sURI.c_str(), blnIsNewNamespace);
+ if( (m_pachPrefix != NULL) && (strlen(m_pachPrefix) != 0)) {
+ pSZ.Serialize(m_pachPrefix, ":", NULL);
+ } else if ( (m_pachURI != NULL) && (strlen(m_pachURI) != 0)) {
+ const AxisChar* pachTmp = pSZ.GetNamespacePrefix(m_pachURI, blnIsNewNamespace);
+ m_pachPrefix = (AxisChar*) malloc(strlen(pachTmp)+1);
+ strcpy(m_pachPrefix , pachTmp);
+
if (blnIsNewNamespace) {
- lstTmpNameSpaceStack.push_back((AxisChar*)m_sURI.c_str());
+ lstTmpNameSpaceStack.push_back(m_pachURI);
}
- pSZ.Serialize(m_sPrefix.c_str(), ":", NULL);
+ pSZ.Serialize(m_pachPrefix, ":", NULL);
}
- pSZ.Serialize(m_sLocalName.c_str(), NULL);
+ pSZ.Serialize(m_pachLocalName, NULL);
- if((m_sPrefix.length() != 0) && (m_sURI.length() != 0) && (blnIsNewNamespace)) {
- pSZ.Serialize(" xmlns:", m_sPrefix.c_str(), "=\"", m_sURI.c_str(), "\"", NULL);
+ if(((m_pachPrefix != NULL) && (strlen(m_pachPrefix) != 0)) &&
+ ( (m_pachURI != NULL) && (strlen(m_pachURI) != 0)) &&
+ (blnIsNewNamespace)) {
+ pSZ.Serialize(" xmlns:", m_pachPrefix, "=\"", m_pachURI, "\"", NULL);
}
pSZ.Serialize(">", NULL);
@@ -166,10 +202,10 @@
break;
}
pSZ.Serialize("</", NULL);
- if(m_sPrefix.length() != 0) {
- pSZ.Serialize(m_sPrefix.c_str(), ":", NULL);
+ if((m_pachPrefix!=NULL) && (strlen(m_pachPrefix) != 0)) {
+ pSZ.Serialize(m_pachPrefix, ":", NULL);
}
- pSZ.Serialize(m_sLocalName.c_str(), ">", NULL);
+ pSZ.Serialize(m_pachLocalName, ">", NULL);
iStatus= AXIS_SUCCESS;
}
else
@@ -180,58 +216,12 @@
return iStatus;
}
-/*
-comm on 10/7/2003 6.20pm
-int ComplexElement::serialize(string &sSerialized)
-{
- int iStatus= AXIS_SUCCESS;
-
- do {
- if(isSerializable()) {
-
- sSerialized+= "<";
-
- if(m_sPrefix.length() != 0) {
- sSerialized+= m_sPrefix+ ":";
- }
-
- sSerialized+= m_sLocalName;
-
- if((m_sPrefix.length() != 0) && (m_sURI.length() != 0)) {
- sSerialized+= " xmlns:"+ m_sPrefix+ "=\""+ m_sURI+ "\"";
- }
-
- sSerialized+= ">";
-
- iStatus= serializeChildren(sSerialized);
- if(iStatus==AXIS_FAIL) {
- break;
- }
-
- sSerialized+= "</";
-
- if(m_sPrefix.length() != 0) {
- sSerialized+= m_sPrefix+ ":";
- }
-
- sSerialized+= m_sLocalName+ ">"+ "\n";
-
- iStatus= AXIS_SUCCESS;
- } else {
- iStatus= AXIS_FAIL;
- }
- } while(0);
-
- return iStatus;
-}
-*/
-
bool ComplexElement::isSerializable()
{
bool bStatus= true;
do {
- if(m_sLocalName.length()==0) {
+ if(strlen(m_pachLocalName) == 0) {
bStatus= false;
break;
}
@@ -240,9 +230,10 @@
return bStatus;
}
-int ComplexElement::setURI(const AxisChar* sURI)
+int ComplexElement::setURI(const AxisChar* pachURI)
{
- m_sURI= sURI;
+ m_pachURI = (AxisChar*) malloc(strlen(pachURI)+1);
+ strcpy(m_pachURI, pachURI);
return AXIS_SUCCESS;
}
@@ -277,47 +268,56 @@
return AXIS_SUCCESS;
}
-/*
-comm on 10/7/2003 6.20pm
-int ComplexElement::serializeChildren(string &sSerialized)
+NODE_TYPE ComplexElement::getNodeType()
{
+ return m_iNodeType;
+}
- list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
+BasicNode* ComplexElement::getFirstChild()
+{
+ list<BasicNode*>::iterator itCurrChild= m_children.begin();
- while(itCurrBasicNode != m_children.end()) {
- (*itCurrBasicNode)->serialize(sSerialized);
- itCurrBasicNode++;
+ if (itCurrChild != m_children.end()) {
+ return (*itCurrChild);
}
- return AXIS_SUCCESS;
+ return NULL;
}
-*/
-NODE_TYPE ComplexElement::getNodeType()
+BasicNode* ComplexElement::getLastChild()
{
- return m_iNodeType;
+ list<BasicNode*>::reverse_iterator ritCurrChild= m_children.rbegin();
+
+ if (ritCurrChild != m_children.rend()) {
+ return (*ritCurrChild);
+ }
+
+ return NULL;
}
-/*
- *This method is overridden to return a blank string always because this is
- * a Complex Element. Instead of using this method, a user of a
- * ComplexElement must get the childeren of this ComplexElement and
- * has to traverse through the childrean in a appropriate manner
- * in order to get there values.
- */
-const AxisString& ComplexElement::getValue()
-{
- return m_sValue;
-}
-
-/*
- *This method is overridden to do nothing always because this is
- * a Complex Element. Instead of using this method, a user of a
- * ComplexElement must get the childeren of this ComplexElement and
- * has to traverse through the childrean in a appropriate manner
- * in order to set there values.
- */
-int ComplexElement::setValue(const AxisChar* sValue)
+BasicNode* ComplexElement::getChild(int iChildPosition)
{
- return AXIS_SUCCESS;
+ if (iChildPosition > iNoOfChildren) {
+ return NULL;
+ } else {
+ list<BasicNode*>::iterator itCurrChild= m_children.begin();
+ /*The following is done since the previous line already takes the iterator one step forward */
+ iChildPosition--;
+
+ /*Takes the iterator to the relavent positon*/
+ for (int i=0; i<iChildPosition; i++) {
+ itCurrChild++;
+ }
+
+ if (itCurrChild != m_children.end()) {
+ return *itCurrChild;
+ } else {
+ return NULL;
+ }
+ }
}
+
+int ComplexElement::getNoOfChildren()
+{
+ return iNoOfChildren;
+}
\ No newline at end of file
1.12 +218 -58 ws-axis/c/src/soap/HeaderBlock.cpp
Index: HeaderBlock.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- HeaderBlock.cpp 13 Feb 2004 07:42:44 -0000 1.11
+++ HeaderBlock.cpp 28 Feb 2004 06:27:56 -0000 1.12
@@ -82,20 +82,49 @@
HeaderBlock::HeaderBlock()
{
+ iNoOFChildren = 0;
+}
+
+HeaderBlock::HeaderBlock(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri)
+{
+ iNoOFChildren = 0;
+ m_localname = pachLocalName;
+ m_prefix = pachPrefix;
+ m_uri = pachUri;
}
HeaderBlock::~HeaderBlock()
{
+ /*
+ *Clear the Attributes
+ */
list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
-
while(itCurrAttribute != m_attributes.end()) {
-
delete (*itCurrAttribute);
itCurrAttribute++;
}
-
m_attributes.clear();
+
+ /*
+ *Clear the Namespaces
+ */
+ list<Attribute*>::iterator itCurrNamespace= m_namespaceDecls.begin();
+ while(itCurrNamespace != m_namespaceDecls.end()) {
+ delete (*itCurrNamespace);
+ itCurrNamespace++;
+ }
+ m_namespaceDecls.clear();
+
+ /*
+ *Clear the children
+ */
+ list<BasicNode*>::iterator itCurrChild= m_children.begin();
+ while(itCurrChild != m_children.end()) {
+ delete (*itCurrChild);
+ itCurrChild++;
+ }
+ m_children.clear();
}
void HeaderBlock::setLocalName(const AxisChar* localname)
@@ -118,13 +147,6 @@
m_attributes.push_back(attr);
}
-void HeaderBlock::setValue(const AxisChar* value)
-{
- //m_value= value;
-
- /* I think that now this method is not needed, roshan */
-}
-
int HeaderBlock::serialize(SoapSerializer& pSZ)
{
/*
@@ -207,33 +229,8 @@
return iStatus;
}
-/*
-comm on 10/7/2003 6.00pm
-int HeaderBlock::attrSerialize(string& sSerialized)
-{
- int iStatus= AXIS_SUCCESS;
-
- list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
-
- while(itCurrAttribute != m_attributes.end()) {
-
- iStatus= (*itCurrAttribute)->serialize(sSerialized);
- if(iStatus==AXIS_FAIL) {
- break;
- }
- itCurrAttribute++;
- }
-
- return iStatus;
-}
-*/
-
bool HeaderBlock::isSerializable()
{
- //bool blnStatus= true;
-
- //return blnStatus;
-
bool bStatus= true;
if(m_localname.length() == 0) {
@@ -256,6 +253,7 @@
int HeaderBlock::addChild(BasicNode *pBasicNode)
{
m_children.push_back(pBasicNode);
+ iNoOFChildren++;
return AXIS_SUCCESS;
}
@@ -277,21 +275,6 @@
return AXIS_SUCCESS;
}
-/*
-comm on 10/7/2003 6.00pm
-int HeaderBlock::serializeChildren(string &sSerialized)
-{
- list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
-
- while(itCurrBasicNode != m_children.end()) {
- (*itCurrBasicNode)->serialize(sSerialized);
- itCurrBasicNode++;
- }
-
- return AXIS_SUCCESS;
-}
-*/
-
int HeaderBlock::addNamespaceDecl(Attribute *pAttribute)
{
m_namespaceDecls.push_back(pAttribute);
@@ -311,17 +294,39 @@
return AXIS_SUCCESS;
}
-BasicNode* HeaderBlock::getFirstChild()
+BasicNode* HeaderBlock::getLastChild()
{
- list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
+ list<BasicNode*>::reverse_iterator ritCurrBasicNode= m_children.rbegin();
- if (itCurrBasicNode != m_children.end()) {
- return (*itCurrBasicNode);
+ if (ritCurrBasicNode != m_children.rend()) {
+ return (*ritCurrBasicNode);
}
return NULL;
}
+BasicNode* HeaderBlock::getChild(int iChildPosition)
+{
+ if (iChildPosition > iNoOFChildren) {
+ return NULL;
+ } else {
+ list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
+ /*The following is done since the previous line already takes the iterator one step forward */
+ iChildPosition--;
+
+ /*Takes the iterator to the relavent positon*/
+ for (int i=0; i<iChildPosition; i++) {
+ itCurrBasicNode++;
+ }
+
+ if (itCurrBasicNode != m_children.end()) {
+ return *itCurrBasicNode;
+ } else {
+ return NULL;
+ }
+ }
+}
+
BasicNode* HeaderBlock::createChild(NODE_TYPE eNODE_TYPE)
{
BasicNode* pBasicNode = NULL;
@@ -329,13 +334,12 @@
if(eNODE_TYPE==CHARACTER_NODE) {
pBasicNode = new CharacterElement();
} else if (eNODE_TYPE==ELEMENT_NODE) {
- //do some thing appropriate
+ pBasicNode = new ComplexElement();
}
return pBasicNode;
}
-#ifdef UNIT_TESTING_BUILD
int HeaderBlock::initializeForTesting()
{
setPrefix("m");
@@ -370,7 +374,6 @@
return AXIS_SUCCESS;
}
-#endif
bool HeaderBlock::operator ==( const HeaderBlock &objHeaderBlock)
{
@@ -378,4 +381,161 @@
*TODO : the logic
*/
return true;
-}
\ No newline at end of file
+}
+
+BasicNode* HeaderBlock::createImmediateChild(NODE_TYPE eNODE_TYPE)
+{
+ BasicNode* pBasicNode = NULL;
+
+ do {
+
+ if(eNODE_TYPE==CHARACTER_NODE) {
+ pBasicNode = new CharacterElement();
+ } else if (eNODE_TYPE==ELEMENT_NODE) {
+ pBasicNode = new ComplexElement();
+ } else {
+ break;
+ }
+
+ m_children.push_back(pBasicNode);
+ iNoOFChildren++;
+ } while (0);
+
+ return pBasicNode;
+}
+
+Attribute* HeaderBlock::createAttribute(const AxisChar *localname, const AxisChar *prefix, const AxisChar *value)
+{
+ Attribute* pAttribute = new Attribute(localname, prefix, value);
+ m_attributes.push_back(pAttribute);
+
+ return pAttribute;
+}
+
+Attribute* HeaderBlock::createAttribute(const AxisChar *localname, const AxisChar *prefix, const AxisChar *uri, const AxisChar *value)
+{
+ Attribute* pAttribute = new Attribute(localname, prefix, uri, value);
+ m_attributes.push_back(pAttribute);
+
+ return pAttribute;
+}
+
+Attribute* HeaderBlock::createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, SOAP_VERSION eSOAP_VERSION)
+{
+ Attribute* pAttribute = NULL;
+ bool blnStatus = true;
+
+ do {
+ switch(eSOAP_VERSION) {
+ case VERSION_LAST:
+ blnStatus = false;
+ break;
+ case SOAP_VER_1_1:
+ switch(eStdAttrType) {
+ case ACTOR:
+ pAttribute = new Attribute("actor",gs_SoapEnvVersionsStruct[SOAP_VER_1_1].pchPrefix,"","http://schemas.xmlsoap.org/soap/actor/next");
+ break;
+ case MUST_UNDERSTAND_TRUE:
+ pAttribute = new Attribute("mustUnderstand",gs_SoapEnvVersionsStruct[SOAP_VER_1_1].pchPrefix,"","1");
+ break;
+ case MUST_UNDERSTAND_FALSE:
+ pAttribute = new Attribute("mustUnderstand",gs_SoapEnvVersionsStruct[SOAP_VER_1_1].pchPrefix,"","0");
+ break;
+ default:
+ blnStatus = false;
+ break;
+ }
+ break;
+
+ case SOAP_VER_1_2:
+ switch(eStdAttrType) {
+ case ROLE_NEXT:
+ pAttribute = new Attribute("role",gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,"","http://www.w3.org/2003/05/soap-envelope/role/next");
+ break;
+ case ROLE_NONE:
+ pAttribute = new Attribute("role",gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,"","http://www.w3.org/2003/05/soap-envelope/role/none");
+ break;
+ case ROLE_ULTIMATE_RECEIVER:
+ pAttribute = new Attribute("role",gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,"","http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver");
+ break;
+ case MUST_UNDERSTAND_TRUE:
+ pAttribute = new Attribute("mustUnderstand",gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,"","true");
+ break;
+ case MUST_UNDERSTAND_FALSE:
+ pAttribute = new Attribute("mustUnderstand",gs_SoapEnvVersionsStruct[SOAP_VER_1_2].pchPrefix,"","false");
+ break;
+ default:
+ blnStatus = false;
+ break;
+ }
+ break;
+
+ default:
+ blnStatus = false;
+ break;
+ }
+ } while (0);
+
+
+ if (blnStatus) {
+ m_attributes.push_back(pAttribute);
+ return pAttribute;
+ } else {
+ return NULL;
+ }
+}
+
+BasicNode* HeaderBlock::createImmediateChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue)
+{
+ BasicNode* pBasicNode = NULL;
+
+ do {
+
+ if(eNODE_TYPE==CHARACTER_NODE) {
+ pBasicNode = new CharacterElement(pachValue);
+ } else if (eNODE_TYPE==ELEMENT_NODE) {
+ pBasicNode = new ComplexElement(pachLocalName, pachPrefix, pachUri);
+ } else {
+ break;
+ }
+
+ m_children.push_back(pBasicNode);
+ iNoOFChildren++;
+ } while (0);
+
+ return pBasicNode;
+}
+
+BasicNode* HeaderBlock::createChild(NODE_TYPE eNODE_TYPE, AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar *pachValue)
+{
+ BasicNode* pBasicNode = NULL;
+
+ do {
+
+ if(eNODE_TYPE==CHARACTER_NODE) {
+ pBasicNode = new CharacterElement(pachValue);
+ } else if (eNODE_TYPE==ELEMENT_NODE) {
+ pBasicNode = new ComplexElement(pachLocalName, pachPrefix, pachUri);
+ } else {
+ break;
+ }
+ } while (0);
+
+ return pBasicNode;
+}
+
+int HeaderBlock::getNoOfChildren()
+{
+ return iNoOFChildren;
+}
+
+BasicNode* HeaderBlock::getFirstChild()
+{
+ list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();
+
+ if (itCurrBasicNode != m_children.end()) {
+ return (*itCurrBasicNode);
+ }
+
+ return NULL;
+}
1.14 +1 -2 ws-axis/c/src/soap/SoapBody.cpp
Index: SoapBody.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapBody.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SoapBody.cpp 3 Feb 2004 13:04:47 -0000 1.13
+++ SoapBody.cpp 28 Feb 2004 06:27:56 -0000 1.14
@@ -167,7 +167,6 @@
return iStatus;
}
-#ifdef UNIT_TESTING_BUILD
int SoapBody::initializeForTesting()
{
SoapMethod* pSoapMethod = new SoapMethod();
@@ -177,4 +176,4 @@
return AXIS_SUCCESS;
}
-#endif
+
1.28 +3 -2 ws-axis/c/src/soap/SoapDeSerializer.cpp
Index: SoapDeSerializer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- SoapDeSerializer.cpp 13 Feb 2004 07:42:44 -0000 1.27
+++ SoapDeSerializer.cpp 28 Feb 2004 06:27:56 -0000 1.28
@@ -173,8 +173,8 @@
IHeaderBlock* SoapDeSerializer::GetHeaderBlock(const AxisChar* pName, const AxisChar* pNamespace)
{
if (!m_pHeader) return NULL; /* there has been no <Header> element so there can be no Header blocks */
-
- return (HeaderBlock*)m_pHeader->getHeaderBlock(pName, pNamespace);
+
+ return m_pHeader->getHeaderBlock(pName, pNamespace);
}
int SoapDeSerializer::GetHeader()
@@ -204,6 +204,7 @@
if ((END_ELEMENT == m_pNode->m_type) && (0 == strcmp(m_pNode->m_pchNameOrValue, SoapKeywordMapping::Map(m_nSoapVersion).pchWords[SKW_HEADER]))) {
m_pNode = NULL; /*This is to indicate that node is identified and used */
return m_nStatus;
+ break;
} else {
if (START_ELEMENT == m_pNode->m_type) {
if (iLevel == HEADER_LEVEL) {
1.13 +0 -2 ws-axis/c/src/soap/SoapEnvelope.cpp
Index: SoapEnvelope.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapEnvelope.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SoapEnvelope.cpp 3 Feb 2004 13:04:47 -0000 1.12
+++ SoapEnvelope.cpp 28 Feb 2004 06:27:56 -0000 1.13
@@ -308,7 +308,6 @@
return AXIS_SUCCESS;
}
-#ifdef UNIT_TESTING_BUILD
int SoapEnvelope::initializeForTesting(SOAP_VERSION eSoapVersion)
{
if(eSoapVersion == SOAP_VER_1_2) {
@@ -328,5 +327,4 @@
return AXIS_SUCCESS;
}
-#endif
1.14 +5 -5 ws-axis/c/src/soap/SoapHeader.cpp
Index: SoapHeader.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapHeader.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SoapHeader.cpp 13 Feb 2004 07:42:44 -0000 1.13
+++ SoapHeader.cpp 28 Feb 2004 06:27:56 -0000 1.14
@@ -221,17 +221,17 @@
while (itCurrHeaderBlock != m_headerBlocks.end()) {
tmpHeaderBlock = (*itCurrHeaderBlock);
- if ((strcmp((tmpHeaderBlock->m_localname).c_str(), pName) == 0) &&
- (strcmp((tmpHeaderBlock->m_uri).c_str(), pNamespace) == 0)) {
+ if ((strcmp(((tmpHeaderBlock)->m_localname).c_str(), pName) == 0) &&
+ (strcmp(((tmpHeaderBlock)->m_uri).c_str(), pNamespace) == 0)) {
blnFoundStatus = true;
m_headerBlocks.remove(tmpHeaderBlock);
break;
+ } else {
+ itCurrHeaderBlock++;
}
-
- itCurrHeaderBlock++;
}
- if (blnFoundStatus) {
+ if (blnFoundStatus == true) {
return tmpHeaderBlock;
} else {
return NULL;
1.18 +0 -2 ws-axis/c/src/soap/SoapMethod.cpp
Index: SoapMethod.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapMethod.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SoapMethod.cpp 3 Feb 2004 13:04:47 -0000 1.17
+++ SoapMethod.cpp 28 Feb 2004 06:27:56 -0000 1.18
@@ -300,7 +300,6 @@
return AXIS_SUCCESS;
}
-#ifdef UNIT_TESTING_BUILD
int SoapMethod::initializeForTesting()
{
m_strPrefix = "mn";
@@ -318,6 +317,5 @@
return AXIS_SUCCESS;
}
-#endif
1.38 +8 -2 ws-axis/c/src/soap/SoapSerializer.cpp
Index: SoapSerializer.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- SoapSerializer.cpp 3 Feb 2004 13:04:47 -0000 1.37
+++ SoapSerializer.cpp 28 Feb 2004 06:27:56 -0000 1.38
@@ -560,14 +560,13 @@
return AXIS_SUCCESS;
}
-#ifdef UNIT_TESTING_BUILD
int SoapSerializer::setOutputStreamForTesting(const Ax_soapstream* pStream)
{
m_pOutputStream = pStream;
return AXIS_SUCCESS;
}
-#endif
+
/**
* Basic output parameter going to be serialized as an Element later
*/
@@ -761,4 +760,11 @@
*pInt = 0; /* set that the buffer is not in use */
char *pChar = const_cast<char*>(buffer);
pChar[0] = '\0'; /* set nul */
+}
+
+IHeaderBlock* SoapSerializer::createHeaderBlock(AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri)
+{
+ HeaderBlock* pHeaderBlock= new HeaderBlock(pachLocalName, pachPrefix, pachUri);
+ setHeaderBlock(pHeaderBlock);
+ return pHeaderBlock;
}
1.20 +2 -2 ws-axis/c/vc/server/apache1_3/Apache1_3.dsp
Index: Apache1_3.dsp
===================================================================
RCS file: /home/cvs/ws-axis/c/vc/server/apache1_3/Apache1_3.dsp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Apache1_3.dsp 3 Feb 2004 13:04:48 -0000 1.19
+++ Apache1_3.dsp 28 Feb 2004 06:27:56 -0000 1.20
@@ -54,7 +54,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 Common.lib Soap.lib wsdd.lib Engine.lib libexpat.lib ApacheCore.lib client.lib wsock32.lib /nologo /dll /machine:I386 /out:"C:\Program Files\Apache Group\Apache\modules\mod_axis.dll" /libpath:"../../../lib/axis" /libpath:"../../../lib/apache1_3" /libpath:"../../../lib/expat"
+# ADD LINK32 Common.lib Soap.lib wsdd.lib Engine.lib libexpat.lib ApacheCore.lib client.lib wsock32.lib /nologo /dll /machine:I386 /out:"d:\Program Files\Apache Group\Apache\modules\mod_axis.dll" /libpath:"../../../lib/axis" /libpath:"../../../lib/apache1_3" /libpath:"../../../lib/expat"
# SUBTRACT LINK32 /profile
!ELSEIF "$(CFG)" == "Apache1_3 - Win32 Debug"
@@ -81,7 +81,7 @@
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 Common_D.lib Soap_D.lib wsdd_D.lib Engine_D.lib ApacheCore.lib wsock32.lib libexpat.lib client_D.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Apache Group\Apache\modules\mod_axis.dll" /pdbtype:sept /libpath:"../../../lib/axis" /libpath:"../../../lib/apache1_3" /libpath:"../../../lib/expat"
+# ADD LINK32 Common_D.lib Soap_D.lib wsdd_D.lib Engine_D.lib ApacheCore.lib wsock32.lib libexpat.lib client_D.lib /nologo /dll /debug /machine:I386 /out:"d:\Program Files\Apache Group\Apache\modules\mod_axis.dll" /pdbtype:sept /libpath:"../../../lib/axis" /libpath:"../../../lib/apache1_3" /libpath:"../../../lib/expat"
# SUBTRACT LINK32 /profile
!ENDIF