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 su...@apache.org on 2003/07/16 16:21:20 UTC
cvs commit: xml-axis/c/src/soap XMLStreamHandler.cpp SoapSerializer.h SoapSerializer.cpp SoapMethod.h SoapMethod.cpp SoapDeSerializer.h SoapDeSerializer.cpp
susantha 2003/07/16 07:21:20
Modified: c/src/soap XMLStreamHandler.cpp SoapSerializer.h
SoapSerializer.cpp SoapMethod.h SoapMethod.cpp
SoapDeSerializer.h SoapDeSerializer.cpp
Log:
changes done for,
1. minimizing duplicate code linking with webservices
2. processing multidimensional arrays support for soap 1.1
Revision Changes Path
1.2 +9 -3 xml-axis/c/src/soap/XMLStreamHandler.cpp
Index: XMLStreamHandler.cpp
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/XMLStreamHandler.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLStreamHandler.cpp 25 Jun 2003 07:39:08 -0000 1.1
+++ XMLStreamHandler.cpp 16 Jul 2003 14:21:08 -0000 1.2
@@ -366,7 +366,7 @@
if(URIMapping::Map(m_NsStack[sPrefix]) == URI_XSD)
{
//check for xml data types
- m_Param.m_Value.a->t = TypeMapping::Map(sType);
+ m_Param.m_Value.a->m_type = TypeMapping::Map(sType);
}
else
{
@@ -415,8 +415,14 @@
// being parsed.
int XMLStreamHandler::SetArrayDimensions(string &sDimensions)
{
- //For the moment assumed only one dimensional arrays eg : "[8]"
- m_Param.m_Value.a->s = atoi((sDimensions.substr(1, sDimensions.find(']'))).c_str());
+ int si=0;
+ int ei=0;
+ do
+ {
+ si = sDimensions.find('[',ei);
+ ei = sDimensions.find(']',si);
+ m_Param.m_Value.a->m_size.push_back(atoi((sDimensions.substr(si+1,ei)).c_str()));
+ } while (sDimensions.find('[',ei) != string::npos);
return SUCCESS;
}
1.4 +11 -4 xml-axis/c/src/soap/SoapSerializer.h
Index: SoapSerializer.h
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SoapSerializer.h 15 Jul 2003 06:59:34 -0000 1.3
+++ SoapSerializer.h 16 Jul 2003 14:21:08 -0000 1.4
@@ -72,13 +72,20 @@
#pragma once
#endif // _MSC_VER > 1000
-#include "SoapEnvelope.h"
#include "../common/ISoapSerializer.h"
+#include "SoapEnvVersions.h"
+
+class SoapEnvelope;
+class SoapHeader;
+class SoapMethod;
+class SoapBody;
+class SoapFault;
class SoapSerializer : public ISoapSerializer
{
private:
static int iCounter;
+ char cCounter[64];
SoapEnvelope* m_pSoapEnvelope;
int m_iSoapVersion;
char m_cSerializedBuffer[1024];
@@ -86,8 +93,8 @@
public:
ISoapMethod* createSoapMethod();
int flushSerializedBuffer();
- SoapSerializer& operator<<(const char *cSerialized);
- static string getNewNamespacePrefix();
+ ISoapSerializer& operator<<(const char *cSerialized);
+ const char* getNewNamespacePrefix();
int setSoapVersion(SOAP_VERSION);
void init();
int getStream();
@@ -98,7 +105,7 @@
int setSoapEnvelope(SoapEnvelope* pSoapEnvelope);
SoapSerializer();
virtual ~SoapSerializer();
- int setResponseParam(Param& param);
+ int setResponseParam(Param* param);
};
#endif // !defined(AFX_SOAPSERIALIZER_H__C37229AD_BD54_430D_9619_E4574CF95334__INCLUDED_)
1.5 +6 -10 xml-axis/c/src/soap/SoapSerializer.cpp
Index: SoapSerializer.cpp
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapSerializer.cpp 15 Jul 2003 06:59:34 -0000 1.4
+++ SoapSerializer.cpp 16 Jul 2003 14:21:08 -0000 1.5
@@ -65,9 +65,9 @@
//
//////////////////////////////////////////////////////////////////////
+#include "SoapEnvelope.h"
#include "SoapSerializer.h"
#include "../common/GDefine.h"
-#include <iostream>
extern "C" int sendSoapResponse(char *cSerializedStream);
@@ -130,7 +130,7 @@
return intStatus;
}
-int SoapSerializer::setResponseParam(Param ¶m)
+int SoapSerializer::setResponseParam(Param *param)
{
int intStatus= FAIL;
@@ -205,23 +205,19 @@
return SUCCESS;
}
-string SoapSerializer::getNewNamespacePrefix()
+const char* SoapSerializer::getNewNamespacePrefix()
{
iCounter++;
-
- char cCounter[64];
- sprintf(cCounter, "%d", iCounter);
-
- return string("ns")+ cCounter;
+ sprintf(cCounter, "ns%d", iCounter);
+ return cCounter;
}
-SoapSerializer& SoapSerializer::operator <<(const char *cSerialized)
+ISoapSerializer& SoapSerializer::operator <<(const char *cSerialized)
{
int iTmpSerBufferSize= strlen(cSerialized);
if((m_iCurrentSerBufferSize+iTmpSerBufferSize)>1023) {
flushSerializedBuffer();
}
- cout<<cSerialized;
strcat(m_cSerializedBuffer, cSerialized);
//cout<<m_cSerializedBuffer<<"END@@";
1.5 +2 -1 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapMethod.h 15 Jul 2003 06:59:34 -0000 1.4
+++ SoapMethod.h 16 Jul 2003 14:21:08 -0000 1.5
@@ -74,6 +74,7 @@
#include "../common/Param.h"
#include "../common/ISoapMethod.h"
+#include "SoapSerializer.h"
#include <list>
class Attribute;
@@ -123,7 +124,7 @@
string& getMethodName();
int serialize(SoapSerializer& pSZ);
//int serialize(string&);
- void setOutputParam(Param ¶m);
+ void setOutputParam(Param *param);
void addInputParam(Param* param);
void setUri(const string &uri);
void setLocalName(const string &localname);
1.5 +6 -8 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.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SoapMethod.cpp 15 Jul 2003 06:59:34 -0000 1.4
+++ SoapMethod.cpp 16 Jul 2003 14:21:08 -0000 1.5
@@ -66,7 +66,6 @@
//////////////////////////////////////////////////////////////////////
#include "SoapMethod.h"
-#include "SoapSerializer.h"
#include "Attribute.h"
#include "../common/GDefine.h"
@@ -111,9 +110,12 @@
m_inputParams.push_back(param);
}
-void SoapMethod::setOutputParam(Param ¶m)
+void SoapMethod::setOutputParam(Param *param)
{
- *m_pOutputParam = param;
+ if (param)
+ {
+ *m_pOutputParam = *param;
+ }
}
/*
@@ -215,11 +217,7 @@
int SoapMethod::serializeOutputParam(SoapSerializer& pSZ)
{
- //serialization sould come here
- //return m_pOutputParam->serialize(pSZ);
-
- pSZ<<"serialization of output param";
- return SUCCESS;
+ return m_pOutputParam->serialize(pSZ);
}
/*
1.3 +7 -7 xml-axis/c/src/soap/SoapDeSerializer.h
Index: SoapDeSerializer.h
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapDeSerializer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SoapDeSerializer.h 15 Jul 2003 07:05:06 -0000 1.2
+++ SoapDeSerializer.h 16 Jul 2003 14:21:08 -0000 1.3
@@ -71,14 +71,14 @@
#pragma once
#endif // _MSC_VER > 1000
-#include "XMLStreamHandler.h"
-#include "SoapEnvelope.h"
-#include "SoapHeader.h"
-#include "SoapMethod.h"
-#include "SoapBody.h"
-#include "SoapFault.h"
-#include "../common/Param.h"
#include "../common/ISoapDeSerializer.h"
+#include "XMLStreamHandler.h"
+
+class SoapEnvelope;
+class SoapHeader;
+class SoapMethod;
+class SoapBody;
+class SoapFault;
class SoapDeSerializer : public ISoapDeSerializer
{
1.2 +6 -2 xml-axis/c/src/soap/SoapDeSerializer.cpp
Index: SoapDeSerializer.cpp
===================================================================
RCS file: /home/cvs/xml-axis/c/src/soap/SoapDeSerializer.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SoapDeSerializer.cpp 25 Jun 2003 08:14:10 -0000 1.1
+++ SoapDeSerializer.cpp 16 Jul 2003 14:21:08 -0000 1.2
@@ -64,7 +64,11 @@
// SoapDeSerializer.cpp: implementation of the SoapDeSerializer class.
//
//////////////////////////////////////////////////////////////////////
-
+#include "SoapEnvelope.h"
+#include "SoapHeader.h"
+#include "SoapMethod.h"
+#include "SoapBody.h"
+#include "SoapFault.h"
#include "SoapDeSerializer.h"
#include "../common/GDefine.h"
@@ -126,7 +130,7 @@
switch (pParam->m_Type)
{
case XSD_ARRAY:
- if (pParam->m_Value.a && pParam->m_Value.a->v.so)
+ if (pParam->m_Value.a && pParam->m_Value.a->m_value.sta)
{
pParam->m_Value.a->DeSerialize(this);
}