axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject cvs commit: ws-axis/c/vc AxisServerDLL.dsp AxisClientDLL.dsp
Date Tue, 04 Jan 2005 05:50:02 GMT
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("<?xml version='1.0' encoding='utf-8' ?>", 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<AxisXMLString, SoapAttachment*>::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 <axis/WSDDDefines.hpp>
  +#include "SoapAttachment.hpp"
   
   AXIS_CPP_NAMESPACE_START
   
  @@ -47,9 +48,10 @@
   class SoapSerializer : public IHandlerSoapSerializer
   {
   private:
  +	map<AxisString, SoapAttachment*> 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<AxisString, AxisString>::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 <map>
  #include <string>
  #include <axis/GDefine.hpp>
  
  AXIS_CPP_NAMESPACE_START
  using namespace std;
  
  class SoapSerializer;
  
  class SoapAttachementHeaders  
  {
  private:
  	map<AxisString, AxisString> 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 <axis/GDefine.hpp>
  #include <axis/AxisUserAPI.hpp>
  #include "SoapAttachementHeaders.hpp"
  
  #include <string>
  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
  
  
  

Mime
View raw message