roshan 2003/06/27 22:08:15
Modified: c/src/soap SoapMethod.h SoapMethod.cpp
Log:
committing c++ code base
Revision Changes Path
1.3 +25 -0 xml-axis/c/src/soap/SoapMethod.h
Index: SoapMethod.h
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapMethod.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SoapMethod.h 27 Jun 2003 03:35:47 -0000 1.2
+++ SoapMethod.h 28 Jun 2003 05:08:15 -0000 1.3
@@ -75,12 +75,35 @@
#include "../common/Param.h"
#include <list>
+class Attribute;
+
using namespace std;
+/**
+ * The SOAP method.
+ *
+ * SOAP Body child Element:
+ * All child element information items of the SOAP Body element information item:
+ * - SHOULD have a [namespace name] property which has a value, that is
the name of the element
+ * SHOULD be namespace qualified.
+ * - MAY have any number of character information item children. Child
character information
+ * items whose character code is amongst the white space characters as
defined by XML 1.0 [XML 1.0]
+ * are considered significant.
+ * - MAY have any number of element information item children. Such
element information items MAY be
+ * namespace qualified.
+ * - MAY have zero or more attribute information items in its
[attributes] property. Among these MAY
+ * be the following, which has special significance for SOAP processing:
+ * - encodingStyle attribute information item
+ *
+ *
+ * @brief The SOAP Body of a SOAP Envelope according to SOAP 1.2 specification.
+ */
+
class SoapMethod
{
private:
+ list<Attribute*> m_attributes;
bool isSerializable();
//string serializeOutputParam();
int serializeOutputParam(string&);
@@ -93,6 +116,8 @@
//test line
public:
+ int serializeAttributes(string& sSerialized);
+ int addAttribute(Attribute* pAttribute);
string& getMethodName();
//string& serialize();
int serialize(string&);
1.3 +41 -14 xml-axis/c/src/soap/SoapMethod.cpp
Index: SoapMethod.cpp
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapMethod.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SoapMethod.cpp 27 Jun 2003 03:35:47 -0000 1.2
+++ SoapMethod.cpp 28 Jun 2003 05:08:15 -0000 1.3
@@ -66,6 +66,7 @@
//////////////////////////////////////////////////////////////////////
#include "SoapMethod.h"
+#include "Attribute.h"
#include "../common/GDefine.h"
//////////////////////////////////////////////////////////////////////
@@ -135,16 +136,22 @@
do {
if(isSerializable()) {
- sSerialized+= "<";
+ sSerialized+= "<" + m_strPrefix+ ":"+ m_strLocalname+ "
xmlns:"+ m_strPrefix+
+ "=\""+ m_strUri+ "\"";
- if(m_strPrefix.length() != 0) {
- sSerialized+= m_strPrefix+ ":";
- }
+// if(m_strPrefix.length() != 0) {
+// sSerialized+= m_strPrefix+ ":";
+// }
- sSerialized+= m_strLocalname;
+// sSerialized+= m_strLocalname;
- if(m_strPrefix.length() != 0) {
- sSerialized+= " xmlns:"+ m_strPrefix+ "=\""+ m_strUri+
"\"";
+// if(m_strPrefix.length() != 0) {
+// sSerialized+= " xmlns:"+ m_strPrefix+ "=\""+ m_strUri+
"\"";
+// }
+
+ iStatus= serializeAttributes(sSerialized);
+ if(iStatus==FAIL) {
+ break;
}
sSerialized+= ">";
@@ -210,15 +217,35 @@
{
bool bStatus= true;
- if(m_strPrefix.length() == 0) {
- if(m_strUri.length() != 0) {
- bStatus= false;
- }
- } else {
- if(m_strUri.length() == 0) {
+ //checking whether namespace qualified, if not return FAIL
+ do {
+ if(m_strPrefix.length() == 0) {
+ bStatus= false;
+ break;
+ } else if(m_strUri.length() == 0) {
bStatus= false;
+ break;
}
- }
+ } while(0);
return bStatus;
+}
+
+int SoapMethod::addAttribute(Attribute *pAttribute)
+{
+ m_attributes.push_back(pAttribute);
+
+ return SUCCESS;
+}
+
+int SoapMethod::serializeAttributes(string &sSerialized)
+{
+ list<Attribute*>::iterator itCurrAttribute= m_attributes.begin();
+
+ while(itCurrAttribute != m_attributes.end()) {
+ (*itCurrAttribute)->serialize(sSerialized);
+ itCurrAttribute++;
+ }
+
+ return SUCCESS;
}