axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: ws-axis/c/src/soap SoapAttachment.cpp SoapAttachment.hpp SoapSerializer.cpp SoapSerializer.h
Date Thu, 16 Jun 2005 14:19:15 GMT
whitlock    2005/06/16 07:19:15

  Modified:    c/include/axis TypeMapping.hpp
               c/include/axis/client Call.hpp
               c/src/common Param.cpp Param.h
               c/src/engine/client Call.cpp
               c/src/soap SoapAttachment.cpp SoapAttachment.hpp
                        SoapSerializer.cpp SoapSerializer.h
  Log:
  Implement referenced attachments in the dynamic client API
  Add Call::addAttachmentParameter
  Put the attachment in ParamValue
  Add SoapAttachment::serializeReference
  
  Revision  Changes    Path
  1.8       +1 -1      ws-axis/c/include/axis/TypeMapping.hpp
  
  Index: TypeMapping.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/TypeMapping.hpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TypeMapping.hpp	3 Jun 2005 10:43:48 -0000	1.7
  +++ TypeMapping.hpp	16 Jun 2005 14:19:15 -0000	1.8
  @@ -45,7 +45,7 @@
                   XSD_POSITIVEINTEGER, XSD_NONPOSITIVEINTEGER, XSD_NEGATIVEINTEGER, \
                   XSD_NORMALIZEDSTRING, XSD_TOKEN, XSD_LANGUAGE, XSD_NAME, \
                   XSD_NCNAME, XSD_ID, XSD_IDREF, XSD_IDREFS, XSD_ENTITY, \
  -                XSD_ENTITIES, XSD_NMTOKENS \
  +                XSD_ENTITIES, XSD_NMTOKENS, ATTACHMENT \
   } XSDTYPE;
   
   /**
  
  
  
  1.32      +4 -0      ws-axis/c/include/axis/client/Call.hpp
  
  Index: Call.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/client/Call.hpp,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Call.hpp	15 Jun 2005 20:24:22 -0000	1.31
  +++ Call.hpp	16 Jun 2005 14:19:15 -0000	1.32
  @@ -96,6 +96,8 @@
       /* Method for adding parameters of basic types */
       virtual void AXISCALL addParameter(void* pValue,const char* pName,
           XSDTYPE nType)=0;
  +	/* Method for adding referenced attachments */
  +	virtual void AXISCALL addAttachmentParameter(ISoapAttachment* att, const char* pName)=0;
   
       /* Methods used by stubs to get a deserialized value of an XML element
        * as basic types
  @@ -376,6 +378,8 @@
       /* Method for adding parameters of basic types */
       void AXISCALL addParameter(void* pValue,const char* pchName,
           XSDTYPE nType);
  +	/* Method for adding referenced attachments */
  +	void AXISCALL addAttachmentParameter(ISoapAttachment* att, const char* pName);
   
       /* Method that set the remote method name */
       void AXISCALL setOperation(const char* pchOperation,
  
  
  
  1.56      +3 -0      ws-axis/c/src/common/Param.cpp
  
  Index: Param.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/Param.cpp,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- Param.cpp	25 May 2005 16:03:16 -0000	1.55
  +++ Param.cpp	16 Jun 2005 14:19:15 -0000	1.56
  @@ -173,6 +173,9 @@
         case XSD_ANY:
                pSZ.serializeAnyObject(m_Value.pAnyObject);
                break;
  +      case ATTACHMENT:
  +            m_Value.pAttachment->serializeReference(pSZ,m_sName.c_str());
  +            break;
         default:
               pSZ.serializeAsElement((AxisChar*) m_sName.c_str (), (IAnySimpleType*) m_AnySimpleType);
               break;
  
  
  
  1.31      +2 -0      ws-axis/c/src/common/Param.h
  
  Index: Param.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/Param.h,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Param.h	25 May 2005 16:03:16 -0000	1.30
  +++ Param.h	16 Jun 2005 14:19:15 -0000	1.31
  @@ -29,6 +29,7 @@
   AXIS_CPP_NAMESPACE_START
   
   class ArrayBean;
  +class SoapAttachment;
   
   class ParamValue
   {
  @@ -39,6 +40,7 @@
       };
       ComplexObjectHandler* pCplxObj;
       AnyType* pAnyObject; /* used to hold AnyType struct for xsd:any */
  +	SoapAttachment* pAttachment;
   };
   
   /*
  
  
  
  1.118     +9 -1      ws-axis/c/src/engine/client/Call.cpp
  
  Index: Call.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/client/Call.cpp,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- Call.cpp	15 Jun 2005 20:24:22 -0000	1.117
  +++ Call.cpp	16 Jun 2005 14:19:15 -0000	1.118
  @@ -1052,10 +1052,18 @@
   
   void Call::addAttachment(ISoapAttachment* att)
   {
  -	m_attachments.push_back(att);
  +	if (NULL==m_pIWSSZ)
  +		m_attachments.push_back(att);
  +	else
  +		m_pIWSSZ->addAttachment(att->getHeader(AXIS_CONTENT_ID),att);
   }
   
   ISoapAttachment* Call::createSoapAttachment()
   {
   	return new SoapAttachment(m_pContentIdSet);
   }
  +
  +void Call::addAttachmentParameter(ISoapAttachment* att, const char* pName)
  +{
  +	m_pIWSSZ->addAttachmentParameter(att,pName);
  +}
  
  
  
  1.12      +10 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SoapAttachment.cpp	16 Jun 2005 09:31:04 -0000	1.11
  +++ SoapAttachment.cpp	16 Jun 2005 14:19:15 -0000	1.12
  @@ -134,6 +134,16 @@
      return getHeader(AXIS_CONTENT_ID);
   }
   
  +void SoapAttachment::serializeReference(SoapSerializer& pSZ, const char *name)
  +{
  +	string data = "<";
  +	data += name;
  +	data += " href=\"cid:";
  +	data += m_AttachmentHeaders->getHeader(AXIS_CONTENT_ID);
  +	data += "\" />";
  +	pSZ.serialize(data.c_str());
  +}
  +
   AXIS_CPP_NAMESPACE_END
   
   
  
  
  
  1.10      +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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SoapAttachment.hpp	16 Jun 2005 09:31:04 -0000	1.9
  +++ SoapAttachment.hpp	16 Jun 2005 14:19:15 -0000	1.10
  @@ -73,6 +73,7 @@
   	void addHeader(const char* pchName, const char* pchValue);
   	SoapAttachment(ContentIdSet *pContentIdSet=NULL);
   	virtual ~SoapAttachment();	
  +	void serializeReference(SoapSerializer& pSZ, const char *name);
   };
   
   AXIS_CPP_NAMESPACE_END
  
  
  
  1.126     +16 -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.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- SoapSerializer.cpp	15 Jun 2005 21:25:00 -0000	1.125
  +++ SoapSerializer.cpp	16 Jun 2005 14:19:15 -0000	1.126
  @@ -1232,6 +1232,22 @@
   	return false;
   }
   
  +void SoapSerializer::addAttachmentParameter(ISoapAttachment* att, const char* pName)
  +{
  +    Param *pParam = new Param();
  +    pParam->m_Value.pAttachment = static_cast<SoapAttachment*>(att);
  +	pParam->m_Type = ATTACHMENT;
  +	
  +    if( m_pSoapEnvelope &&
  +		(m_pSoapEnvelope->m_pSoapBody) &&
  +		(m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod)) 
  +    {
  +        m_pSoapEnvelope->m_pSoapBody->m_pSoapMethod->addOutputParam(pParam);
  +    }
  +    pParam->setName(pName);
  +	m_SoapAttachments[att->getAttachmentId()] = att;
  +}
  +
   IHeaderBlock * SoapSerializer::getCurrentHeaderBlock()
   {
   	return m_pSoapEnvelope->m_pSoapHeader->getCurrentHeaderBlock();
  
  
  
  1.51      +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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- SoapSerializer.h	15 Jun 2005 20:24:22 -0000	1.50
  +++ SoapSerializer.h	16 Jun 2005 14:19:15 -0000	1.51
  @@ -183,6 +183,7 @@
   	void addAttachment(const AxisChar* achId, ISoapAttachment* pAttach);
       void addAttachments(ISoapAttachment** pAttach, int iAttchArraySize);
   	void setContentIdSet(ContentIdSet *pContentIdSet);
  +	void addAttachmentParameter(ISoapAttachment* att, const char* pName);
   	IHeaderBlock* getHeaderBlock(const AxisChar* pcName, const AxisChar* pcNamespace);
   	/*
   	* TODO: Have to remove this method. Date logged 13Jan2005
  
  
  

Mime
View raw message