Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 16568 invoked from network); 4 Jan 2005 09:50:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Jan 2005 09:50:10 -0000 Received: (qmail 481 invoked by uid 500); 4 Jan 2005 09:48:09 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 336 invoked by uid 500); 4 Jan 2005 09:48:05 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 217 invoked by uid 99); 4 Jan 2005 09:48:03 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.opensource.lk (HELO squid.cmb.ac.lk) (202.51.147.3) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 04 Jan 2005 01:47:59 -0800 Received: from [192.168.101.20] ([220.247.228.135]) by squid.cmb.ac.lk (8.12.9/8.12.9) with ESMTP id j049tb8Z053566 for ; Tue, 4 Jan 2005 15:55:42 +0600 (LKT) (envelope-from roshan@opensource.lk) Subject: Re: cvs commit: ws-axis/c/vc AxisServerDLL.dsp AxisClientDLL.dsp From: Roshan Weerasuriya To: axis-c-dev@ws.apache.org In-Reply-To: <20050104055002.86430.qmail@minotaur.apache.org> References: <20050104055002.86430.qmail@minotaur.apache.org> Content-Type: text/plain Organization: Message-Id: <1104832005.1122.12.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 04 Jan 2005 15:46:45 +0600 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi All, I tested this code in Linux and it works fine. I Added the new files to the src/soap/Makefile.am entries. There is no affect to the existing code. Roshan On Tue, 2005-01-04 at 11:50, rangika@apache.org wrote: > rangika 2005/01/03 21:50:01 > > Modified: c/src/soap SoapSerializer.cpp SoapSerializer.h > c/include/axis IWrapperSoapSerializer.hpp > c/vc AxisServerDLL.dsp AxisClientDLL.dsp > Added: c/src/soap SoapAttachementHeaders.cpp > SoapAttachementHeaders.hpp SoapAttachment.cpp > SoapAttachment.hpp > Log: > Serializer support for Attachments > > Revision Changes Path > 1.80 +43 -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.79 > retrieving revision 1.80 > diff -u -r1.79 -r1.80 > --- SoapSerializer.cpp 30 Nov 2004 15:52:04 -0000 1.79 > +++ SoapSerializer.cpp 4 Jan 2005 05:50:00 -0000 1.80 > @@ -233,7 +233,10 @@ > { > serialize("", NULL); > iStatus= m_pSoapEnvelope->serialize(*this, > - (SOAP_VERSION)m_iSoapVersion); > + (SOAP_VERSION)m_iSoapVersion); > + > + serializeAttachments(*this); > + > } > } > catch(AxisSoapException& e) > @@ -916,5 +919,43 @@ > return AXIS_SUCCESS; > } > > -AXIS_CPP_NAMESPACE_END > +void SoapSerializer::serializeAttachments(SoapSerializer &pSZ) > +{ > + /*serializing the attachements*/ > + > + map::iterator itCurrAttach= m_SoapAttachments.begin(); > + > + while(itCurrAttach != m_SoapAttachments.end()) > + { > + ((*itCurrAttach).second)->serialize(pSZ); > + > + itCurrAttach++; > + } > +} > + > +void SoapSerializer::addAttachment(AxisString id, SoapAttachment* objAttach) > +{ > + m_SoapAttachments[id] = objAttach; > +} > + > +void SoapSerializer::addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue) > +{ > + > + if (m_SoapAttachments[achId] == NULL) { > + m_SoapAttachments[achId] = new SoapAttachment(); > + } > + > + m_SoapAttachments[achId]->addHeader(achHeaderName, achHeaderValue); > + > +} > + > +void SoapSerializer::addAttachmentBody(const AxisChar* achId, xsd__base64Binary *pAttchBody) > +{ > + if (m_SoapAttachments[achId] == NULL) { > + m_SoapAttachments[achId] = new SoapAttachment(); > + } > + > + m_SoapAttachments[achId]->addBody(pAttchBody); > +} > > +AXIS_CPP_NAMESPACE_END > \ No newline at end of file > > > > 1.32 +7 -1 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.31 > retrieving revision 1.32 > diff -u -r1.31 -r1.32 > --- SoapSerializer.h 23 Nov 2004 17:21:05 -0000 1.31 > +++ SoapSerializer.h 4 Jan 2005 05:50:00 -0000 1.32 > @@ -22,6 +22,7 @@ > > #include "../common/BasicTypeSerializer.h" > #include > +#include "SoapAttachment.hpp" > > AXIS_CPP_NAMESPACE_START > > @@ -47,9 +48,10 @@ > class SoapSerializer : public IHandlerSoapSerializer > { > private: > + map m_SoapAttachments; > int m_nCounter; > AxisChar m_Buf[BTS_BUFFSIZE]; > - SoapEnvelope* m_pSoapEnvelope; > + SoapEnvelope* m_pSoapEnvelope; > int m_iSoapVersion; > /* Current Serialization Style */ > AXIS_BINDING_STYLE m_nStyle; > @@ -149,9 +151,13 @@ > IHeaderBlock* createHeaderBlock(); > > private: > + void serializeAttachments(SoapSerializer &pSZ); > BasicTypeSerializer m_BTSZ; > SOAPTransport* m_pOutputStream; > public: > + void addAttachmentBody(const AxisChar* achId, xsd__base64Binary* pAttchBody); > + void addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue); > + void addAttachment(AxisString id, SoapAttachment* objAttach); > IHeaderBlock* getHeaderBlock(const AxisChar* pcName, const AxisChar* pcNamespace); > IHeaderBlock* getHeaderBlock(); > IHeaderBlock* getFirstHeaderBlock(); > > > > 1.1 ws-axis/c/src/soap/SoapAttachementHeaders.cpp > > Index: SoapAttachementHeaders.cpp > =================================================================== > /* > * Copyright 2003-2004 The Apache Software Foundation. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. > * You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * 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 Rangika Mendis (rangika@opensource.lk) > * @author Nithyakala Thangarajah (nithya@opensource.lk) > * @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcsworld.com) > * > */ > > > // SoapAttachementHeaders.cpp: implementation of the SoapAttachementHeaders class. > // > ////////////////////////////////////////////////////////////////////// > > #include "SoapAttachementHeaders.hpp" > #include "SoapSerializer.h" > > AXIS_CPP_NAMESPACE_START > > ////////////////////////////////////////////////////////////////////// > // Construction/Destruction > ////////////////////////////////////////////////////////////////////// > > SoapAttachementHeaders::SoapAttachementHeaders() > { > > } > > SoapAttachementHeaders::~SoapAttachementHeaders() > { > > } > > void SoapAttachementHeaders::addHeader(AxisString name, AxisString value) > { > m_AttachHeaders[name] = value; > } > > void SoapAttachementHeaders::serialize(SoapSerializer &pSZ) > { > map::iterator itCurrAttchHeader= m_AttachHeaders.begin(); > > while(itCurrAttchHeader != m_AttachHeaders.end()) > { > pSZ.serialize(((*itCurrAttchHeader).first).c_str(), ": ", NULL); > pSZ.serialize(((*itCurrAttchHeader).second).c_str(), "\n", NULL); > > itCurrAttchHeader++; > } > } > > AXIS_CPP_NAMESPACE_END > > > 1.1 ws-axis/c/src/soap/SoapAttachementHeaders.hpp > > Index: SoapAttachementHeaders.hpp > =================================================================== > /* > * Copyright 2003-2004 The Apache Software Foundation. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. > * You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * 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 Rangika Mendis (rangika@opensource.lk) > * @author Nithyakala Thangarajah (nithya@opensource.lk) > * @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcsworld.com) > * > */ > > // SoapAttachementHeaders.h: interface for the SoapAttachementHeaders class. > // > ////////////////////////////////////////////////////////////////////// > > #if !defined(AFX_SOAPATTACHEMENTHEADERS_H__88A54506_DC18_41D4_B484_AB877ADC42D4__INCLUDED_) > #define AFX_SOAPATTACHEMENTHEADERS_H__88A54506_DC18_41D4_B484_AB877ADC42D4__INCLUDED_ > > #if _MSC_VER > 1000 > #pragma once > #endif // _MSC_VER > 1000 > > #pragma warning( disable : 4786 ) > > #include > #include > #include > > AXIS_CPP_NAMESPACE_START > using namespace std; > > class SoapSerializer; > > class SoapAttachementHeaders > { > private: > map m_AttachHeaders; > public: > > void serialize(SoapSerializer& pSZ); > void addHeader(AxisString name, AxisString value); > SoapAttachementHeaders(); > virtual ~SoapAttachementHeaders(); > > }; > > AXIS_CPP_NAMESPACE_END > #endif // !defined(AFX_SOAPATTACHEMENTHEADERS_H__88A54506_DC18_41D4_B484_AB877ADC42D4__INCLUDED_) > > > > 1.1 ws-axis/c/src/soap/SoapAttachment.cpp > > Index: SoapAttachment.cpp > =================================================================== > /* > * Copyright 2003-2004 The Apache Software Foundation. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. > * You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * 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 Rangika Mendis (rangika@opensource.lk) > * @author Nithyakala Thangarajah (nithya@opensource.lk) > * @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcsworld.com) > * > */ > > // SoapAttachment.cpp: implementation of the SoapAttachment class. > // > ////////////////////////////////////////////////////////////////////// > > #include "SoapAttachment.hpp" > #include "SoapSerializer.h" > > AXIS_CPP_NAMESPACE_START > > ////////////////////////////////////////////////////////////////////// > // Construction/Destruction > ////////////////////////////////////////////////////////////////////// > > SoapAttachment::SoapAttachment() > { > //Assigning to NULL > m_AttachementBody = 0; > } > > SoapAttachment::~SoapAttachment() > { > > } > > void SoapAttachment::addHeader(AxisString name, AxisString value) > { > m_AttachementHeaders.addHeader(name, value); > } > > /* > void SoapAttachment::addBody(AxisString sBody) > { > m_AttachementBody = sBody; > } > */ > > void SoapAttachment::addBody(xsd__base64Binary* objBody) > { > m_AttachementBody = objBody; > } > > void SoapAttachment::serialize(SoapSerializer &pSZ) > { > /* Serialize the Attachment Headers */ > pSZ.serialize("\n", NULL); > m_AttachementHeaders.serialize(pSZ); > > /* Serialize the Attachment Body */ > //pSZ.serialize("\n", m_AttachementBody.c_str(), NULL); > > if (m_AttachementBody) { > pSZ.serialize("\n", NULL); > pSZ.serializeAsChardata(m_AttachementBody, XSD_BASE64BINARY); > } > > pSZ.serialize("\n", NULL); > } > > AXIS_CPP_NAMESPACE_END > > > 1.1 ws-axis/c/src/soap/SoapAttachment.hpp > > Index: SoapAttachment.hpp > =================================================================== > /* > * Copyright 2003-2004 The Apache Software Foundation. > * > * Licensed under the Apache License, Version 2.0 (the "License"); > * you may not use this file except in compliance with the License. > * You may obtain a copy of the License at > * > * http://www.apache.org/licenses/LICENSE-2.0 > * > * Unless required by applicable law or agreed to in writing, software > * distributed under the License is distributed on an "AS IS" BASIS, > * 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 Rangika Mendis (rangika@opensource.lk) > * @author Nithyakala Thangarajah (nithya@opensource.lk) > * @author Roshan Weerasuriya (roshan@opensource.lk, roshan@jkcsworld.com) > * > */ > > > // SoapAttachment.h: interface for the SoapAttachment class. > // > ////////////////////////////////////////////////////////////////////// > > #if !defined(AFX_SOAPATTACHMENT_H__7E7B50DC_21AF_4C6E_83E0_F77985A38E43__INCLUDED_) > #define AFX_SOAPATTACHMENT_H__7E7B50DC_21AF_4C6E_83E0_F77985A38E43__INCLUDED_ > > #if _MSC_VER > 1000 > #pragma once > #endif // _MSC_VER > 1000 > > #include > #include > #include "SoapAttachementHeaders.hpp" > > #include > using namespace std; > > AXIS_CPP_NAMESPACE_START > > class SoapSerializer; > > class SoapAttachment > { > private: > SoapAttachementHeaders m_AttachementHeaders; > xsd__base64Binary* m_AttachementBody; > public: > > void serialize(SoapSerializer& pSZ); > void addBody(xsd__base64Binary* objBody); > void addHeader(AxisString name, AxisString value); > SoapAttachment(); > virtual ~SoapAttachment(); > }; > > AXIS_CPP_NAMESPACE_END > #endif // !defined(AFX_SOAPATTACHMENT_H__7E7B50DC_21AF_4C6E_83E0_F77985A38E43__INCLUDED_) > > > > 1.2 +10 -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.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- IWrapperSoapSerializer.hpp 23 Nov 2004 11:11:11 -0000 1.1 > +++ IWrapperSoapSerializer.hpp 4 Jan 2005 05:50:00 -0000 1.2 > @@ -31,6 +31,12 @@ > * > */ > > +/* > + * Revision 1.1 2005/01/02 Roshan > + * Added addAttachmentBody > + * Added addAttachmentHeader > + */ > + > AXIS_CPP_NAMESPACE_START > > class IWrapperSoapSerializer > @@ -120,6 +126,10 @@ > virtual int serializeAnyObject(AnyType* pAnyObject)=0; > > virtual int serializeAsChardata(void* pValue, XSDTYPE type)=0; > + > + virtual void addAttachmentBody(const AxisChar* achId, xsd__base64Binary* pAttchBody)=0; > + > + virtual void addAttachmentHeader(const AxisChar* achId, const AxisChar* achHeaderName, const AxisChar* achHeaderValue)=0; > }; > > AXIS_CPP_NAMESPACE_END > > > > 1.21 +20 -0 ws-axis/c/vc/AxisServerDLL.dsp > > Index: AxisServerDLL.dsp > =================================================================== > RCS file: /home/cvs/ws-axis/c/vc/AxisServerDLL.dsp,v > retrieving revision 1.20 > retrieving revision 1.21 > diff -u -r1.20 -r1.21 > --- AxisServerDLL.dsp 15 Dec 2004 12:42:21 -0000 1.20 > +++ AxisServerDLL.dsp 4 Jan 2005 05:50:00 -0000 1.21 > @@ -262,6 +262,14 @@ > # End Source File > # Begin Source File > > +SOURCE=..\src\soap\SoapAttachementHeaders.cpp > +# End Source File > +# Begin Source File > + > +SOURCE=..\src\soap\SoapAttachment.cpp > +# End Source File > +# Begin Source File > + > SOURCE=..\src\soap\SoapBody.cpp > # End Source File > # Begin Source File > @@ -351,6 +359,18 @@ > # Begin Source File > > SOURCE=..\include\axis\server\Packet.hpp > +# End Source File > +# Begin Source File > + > +SOURCE=..\src\soap\SoapAttachementHeaders.hpp > +# End Source File > +# Begin Source File > + > +SOURCE=..\src\soap\SoapAttachment.hpp > +# End Source File > +# Begin Source File > + > +SOURCE=..\src\soap\SoapSerializer.h > # End Source File > # End Group > # Begin Group "Resource Files" > > > > 1.24 +8 -0 ws-axis/c/vc/AxisClientDLL.dsp > > Index: AxisClientDLL.dsp > =================================================================== > RCS file: /home/cvs/ws-axis/c/vc/AxisClientDLL.dsp,v > retrieving revision 1.23 > retrieving revision 1.24 > diff -u -r1.23 -r1.24 > --- AxisClientDLL.dsp 24 Nov 2004 14:19:30 -0000 1.23 > +++ AxisClientDLL.dsp 4 Jan 2005 05:50:00 -0000 1.24 > @@ -262,6 +262,14 @@ > # End Source File > # Begin Source File > > +SOURCE=..\src\soap\SoapAttachementHeaders.cpp > +# End Source File > +# Begin Source File > + > +SOURCE=..\src\soap\SoapAttachment.cpp > +# End Source File > +# Begin Source File > + > SOURCE=..\src\soap\SoapBody.cpp > # End Source File > # Begin Source File > > > >