You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ra...@apache.org on 2005/05/05 10:56:13 UTC
cvs commit: ws-axis/c/include/axis ISoapAttachment.hpp IWrapperSoapDeSerializer.hpp IWrapperSoapSerializer.hpp
rangika 2005/05/05 01:56:13
Modified: c/src/server/apache2 Apache2Transport.cpp Apache2Transport.h
AttachmentHelper.cpp AttachmentHelper.h
c/src/soap SoapAttachment.cpp SoapAttachment.hpp
SoapDeSerializer.cpp SoapDeSerializer.h
SoapSerializer.cpp SoapSerializer.h
c/src/transport/axis3 HTTPTransport.hpp
c/src/transport SOAPTransport.h
c/src/server/simple_axis_server SimpleAxisTransport.h
c/include/axis ISoapAttachment.hpp
IWrapperSoapDeSerializer.hpp
IWrapperSoapSerializer.hpp
Log:
Added changes to some files to support attachments
Revision Changes Path
1.10 +16 -9 ws-axis/c/src/server/apache2/Apache2Transport.cpp
Index: Apache2Transport.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/apache2/Apache2Transport.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Apache2Transport.cpp 7 Mar 2005 03:26:37 -0000 1.9
+++ Apache2Transport.cpp 5 May 2005 08:56:13 -0000 1.10
@@ -157,13 +157,13 @@
len_read = ap_get_client_block((request_rec*) m_pContext, pBuffer, *piSize);
if (strstr(pBuffer, "Content-Id")) {
- // pAttachmentHelper = new AttachmentHelper();
+ pAttachmentHelper = new AttachmentHelper();
char *pAttachBuffer = (char*)malloc(1000);
char *mimeBoundary = (char*)malloc(1000);
- // pAttachmentHelper->extract_Attachment(pBuffer);
- // pAttachmentHelper->extract_SOAPMimeHeaders(pBuffer);
- // pAttachmentHelper->extract_Soap(pBuffer);
+ pAttachmentHelper->extract_Attachment(pBuffer);
+ pAttachmentHelper->extract_SOAPMimeHeaders(pBuffer);
+ pAttachmentHelper->extract_Soap(pBuffer);
}
@@ -302,13 +302,20 @@
ISoapAttachment* Apache2Transport::getAttachment(const char* pcAttachmentid)
{
-// ISoapAttachment* pAttch = pAttachmentHelper->getAttachment(pcAttachmentid);
-// return pAttch;
- return NULL;
+ ISoapAttachment* pAttch = pAttachmentHelper->getAttachment(pcAttachmentid);
+ return pAttch;
+// return NULL;
};
char* Apache2Transport::getIncomingSOAPMimeHeaders()
{
-// return pAttachmentHelper->getIncomingSOAPMimeHeaders();
- return NULL;
+ return pAttachmentHelper->getIncomingSOAPMimeHeaders();
+// return NULL;
}
+
+ISoapAttachment** Apache2Transport::getAllAttachments(int *pAttchArraySize)
+{
+ ISoapAttachment** pAttachments = pAttachmentHelper->getAllAttachments(pAttchArraySize);
+ return pAttachments;
+// return NULL;
+};
1.14 +3 -2 ws-axis/c/src/server/apache2/Apache2Transport.h
Index: Apache2Transport.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/apache2/Apache2Transport.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Apache2Transport.h 7 Mar 2005 03:26:37 -0000 1.13
+++ Apache2Transport.h 5 May 2005 08:56:13 -0000 1.14
@@ -47,7 +47,7 @@
#include <string.h>
#endif
-//#include "AttachmentHelper.h"
+#include "AttachmentHelper.h"
#include <axis/ISoapAttachment.hpp>
AXIS_CPP_NAMESPACE_USE
@@ -71,6 +71,7 @@
const char* getTransportProperty(const char* pcKey, bool response=true);
void setAttachment(const char* pcAttachmentid, const char* pcAttachment){};
ISoapAttachment* getAttachment(const char* pcAttachmentid);
+ ISoapAttachment** getAllAttachments(int *pAttchArraySize);
void setEndpointUri(const char* pcEndpointUri)
{m_pcEndpointUri = new char[strlen(pcEndpointUri)+1]; strcpy(m_pcEndpointUri,pcEndpointUri);};
void setSessionId(const char* pcSessionId);
@@ -89,7 +90,7 @@
void setTimeout(const long lSeconds) {};
private:
-// AttachmentHelper* pAttachmentHelper;
+ AttachmentHelper* pAttachmentHelper;
void* m_pContext;
#ifndef CHUNCKED_DATA_SUPPORTED
BufferInfo* m_pBuffers;
1.5 +24 -0 ws-axis/c/src/server/apache2/AttachmentHelper.cpp
Index: AttachmentHelper.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/apache2/AttachmentHelper.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- AttachmentHelper.cpp 23 Mar 2005 15:44:59 -0000 1.4
+++ AttachmentHelper.cpp 5 May 2005 08:56:13 -0000 1.5
@@ -164,3 +164,27 @@
{
return pMime;
}
+
+ISoapAttachment** AttachmentHelper::getAllAttachments(int *pAttchArraySize)
+{
+
+ ISoapAttachment** attachArray = (ISoapAttachment**)new SoapAttachment*[mymap.size()];
+ //SoapAttachment** attachArray = new SoapAttachment*[mymap.size()];
+ map<const string, ISoapAttachment*>::iterator itCurrMap= mymap.begin();
+
+ int i = 0;
+ while(itCurrMap != mymap.end())
+ {
+
+ attachArray[i] = (*itCurrMap).second;
+
+ itCurrMap++;
+ i++;
+ }
+
+ *pAttchArraySize = i;
+
+ return attachArray;
+
+ //return mymap;
+}
\ No newline at end of file
1.6 +1 -0 ws-axis/c/src/server/apache2/AttachmentHelper.h
Index: AttachmentHelper.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/apache2/AttachmentHelper.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AttachmentHelper.h 23 Mar 2005 15:44:59 -0000 1.5
+++ AttachmentHelper.h 5 May 2005 08:56:13 -0000 1.6
@@ -59,6 +59,7 @@
public:
char* getIncomingSOAPMimeHeaders();
ISoapAttachment* getAttachment (const char* pcAttchId);
+ ISoapAttachment** getAllAttachments(int *pAttchArraySize);
void extract_info(string header,const char* label,SoapAttachment* pSoapAttachment, int& iEncodingType);
void extract_SOAPMimeHeaders(char* pBuffer);
void extract_Soap (char* pBuffer);
1.7 +5 -0 ws-axis/c/src/soap/SoapAttachment.cpp
Index: SoapAttachment.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapAttachment.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SoapAttachment.cpp 22 Feb 2005 08:56:34 -0000 1.6
+++ SoapAttachment.cpp 5 May 2005 08:56:13 -0000 1.7
@@ -111,6 +111,11 @@
return m_AttachementHeaders->getHeader(pchName).c_str();
}
+const char* SoapAttachment::getAttachmentId()
+{
+ return getHeader("Content-Id");
+}
+
AXIS_CPP_NAMESPACE_END
1.6 +1 -0 ws-axis/c/src/soap/SoapAttachment.hpp
Index: SoapAttachment.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapAttachment.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SoapAttachment.hpp 22 Feb 2005 08:56:34 -0000 1.5
+++ SoapAttachment.hpp 5 May 2005 08:56:13 -0000 1.6
@@ -58,6 +58,7 @@
int iEncodingStyle;
public:
+ const char* getAttachmentId();
const char* getHeader(const char* pchName);
xsd__base64Binary* getBody();
void serialize(SoapSerializer& pSZ);
1.162 +5 -0 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.161
retrieving revision 1.162
diff -u -r1.161 -r1.162
--- SoapDeSerializer.cpp 4 May 2005 11:18:21 -0000 1.161
+++ SoapDeSerializer.cpp 5 May 2005 08:56:13 -0000 1.162
@@ -4658,6 +4658,11 @@
ISoapAttachment* SoapDeSerializer::getAttachment(const char* pcAttachmentid)
{
return m_pInputStream->getAttachment(pcAttachmentid);
+}
+
+ISoapAttachment** SoapDeSerializer::getAllAttachments(int *pAttchArraySize)
+{
+ return m_pInputStream->getAllAttachments(pAttchArraySize);
}
AXIS_CPP_NAMESPACE_END
1.43 +1 -0 ws-axis/c/src/soap/SoapDeSerializer.h
Index: SoapDeSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- SoapDeSerializer.h 4 May 2005 11:18:21 -0000 1.42
+++ SoapDeSerializer.h 5 May 2005 08:56:13 -0000 1.43
@@ -253,6 +253,7 @@
*Returns the attachemtn object for the given id.
*/
ISoapAttachment* getAttachment(const char* pcAttachmentid);
+ ISoapAttachment** getAllAttachments(int *pAttchArraySize);
/**
* Returns a complex fault as an XML string
1.114 +11 -0 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.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- SoapSerializer.cpp 28 Apr 2005 13:57:37 -0000 1.113
+++ SoapSerializer.cpp 5 May 2005 08:56:13 -0000 1.114
@@ -1503,6 +1503,17 @@
m_SoapAttachments[achId] = pAttach;
}
+void SoapSerializer::addAttachments(ISoapAttachment** pAttach, int iAttchArraySize)
+{
+ for (int i=0; i < iAttchArraySize; i++)
+ {
+ const char *id = ((ISoapAttachment*)pAttach[i])->getAttachmentId();
+ m_SoapAttachments[id] = pAttach[i];
+
+ }
+
+}
+
void SoapSerializer::addAttachmentHeader(const AxisChar * achId,
const AxisChar * achHeaderName,
const AxisChar * achHeaderValue)
1.45 +1 -0 ws-axis/c/src/soap/SoapSerializer.h
Index: SoapSerializer.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- SoapSerializer.h 23 Mar 2005 15:44:59 -0000 1.44
+++ SoapSerializer.h 5 May 2005 08:56:13 -0000 1.45
@@ -178,6 +178,7 @@
void addAttachmentBody(const AxisChar* achId, xsd__base64Binary* pAttchBody);
void addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue);
void addAttachment(const AxisChar* achId, ISoapAttachment* pAttach);
+ void addAttachments(ISoapAttachment** pAttach, int iAttchArraySize);
IHeaderBlock* getHeaderBlock(const AxisChar* pcName, const AxisChar* pcNamespace);
/*
* TODO: Have to remove this method. Date logged 13Jan2005
1.11 +1 -0 ws-axis/c/src/transport/axis3/HTTPTransport.hpp
Index: HTTPTransport.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPTransport.hpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- HTTPTransport.hpp 23 Mar 2005 15:45:02 -0000 1.10
+++ HTTPTransport.hpp 5 May 2005 08:56:13 -0000 1.11
@@ -91,6 +91,7 @@
void setAttachment( const char * pcAttachmentId, const char * pcAttachment) {};
ISoapAttachment * getAttachment( const char * pcAttachmentId) { return NULL;};
+ ISoapAttachment** getAllAttachments(int *pAttchArraySize) { return NULL;};
char * getIncomingSOAPMimeHeaders() {return NULL;}
const char * getLastChannelError();
1.18 +2 -0 ws-axis/c/src/transport/SOAPTransport.h
Index: SOAPTransport.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/SOAPTransport.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- SOAPTransport.h 23 Mar 2005 15:45:02 -0000 1.17
+++ SOAPTransport.h 5 May 2005 08:56:13 -0000 1.18
@@ -292,6 +292,8 @@
* corresponding to the pcAttachmentid is not found.
*/
virtual ISoapAttachment* getAttachment(const char* pcAttachmentid)=0;
+ virtual ISoapAttachment** getAllAttachments(int *pAttchArraySize)=0;
+
virtual char* getIncomingSOAPMimeHeaders()=0;
1.8 +5 -0 ws-axis/c/src/server/simple_axis_server/SimpleAxisTransport.h
Index: SimpleAxisTransport.h
===================================================================
RCS file: /home/cvs/ws-axis/c/src/server/simple_axis_server/SimpleAxisTransport.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SimpleAxisTransport.h 7 Mar 2005 03:26:37 -0000 1.7
+++ SimpleAxisTransport.h 5 May 2005 08:56:13 -0000 1.8
@@ -64,6 +64,11 @@
return NULL;
};
+ ISoapAttachment** getAllAttachments(int *pAttchArraySize)
+ {
+ return NULL;
+ };
+
char* getIncomingSOAPMimeHeaders() {
return "incoming headers";
};
1.4 +1 -1 ws-axis/c/include/axis/ISoapAttachment.hpp
Index: ISoapAttachment.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/ISoapAttachment.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ISoapAttachment.hpp 22 Feb 2005 14:41:54 -0000 1.3
+++ ISoapAttachment.hpp 5 May 2005 08:56:13 -0000 1.4
@@ -46,7 +46,7 @@
class STORAGE_CLASS_INFO ISoapAttachment
{
public:
-
+ virtual const char* getAttachmentId()=0;
/**
* Allows the user to add the Attachment Body
*/
1.9 +1 -0 ws-axis/c/include/axis/IWrapperSoapDeSerializer.hpp
Index: IWrapperSoapDeSerializer.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/IWrapperSoapDeSerializer.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- IWrapperSoapDeSerializer.hpp 4 May 2005 10:36:57 -0000 1.8
+++ IWrapperSoapDeSerializer.hpp 5 May 2005 08:56:13 -0000 1.9
@@ -160,6 +160,7 @@
virtual AnyType* AXISCALL getAnyObject()=0;
virtual void getChardataAs(void* pValue, XSDTYPE type)=0;
virtual ISoapAttachment* getAttachment(const char* pcAttachmentid)=0;
+ virtual ISoapAttachment** getAllAttachments(int *pAttchArraySize)=0;
/**
* This method allows to peek for the name of the next element in XML stream.
* Useful in supporting "all" & "choice" WSDL constructs.
1.9 +2 -0 ws-axis/c/include/axis/IWrapperSoapSerializer.hpp
Index: IWrapperSoapSerializer.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/include/axis/IWrapperSoapSerializer.hpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- IWrapperSoapSerializer.hpp 23 Mar 2005 15:44:53 -0000 1.8
+++ IWrapperSoapSerializer.hpp 5 May 2005 08:56:13 -0000 1.9
@@ -160,6 +160,8 @@
virtual void addAttachment(const AxisChar* achId, ISoapAttachment* objAttach)=0;
+ virtual void addAttachments(ISoapAttachment** pAttach, int iAttchArraySize)=0;
+
virtual void addAttachmentBody(const AxisChar* achId, xsd__base64Binary* pAttchBody)=0;
virtual void addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue)=0;