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/src/soap SoapSerializer.cpp
Date Fri, 28 Jan 2005 11:17:08 GMT
rangika     2005/01/28 03:17:08

  Modified:    c/src/soap SoapSerializer.cpp
  Log:
  serializeAsCharData() doesn't serialize base64 properly.So I modified it.
  
  Revision  Changes    Path
  1.91      +18 -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.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- SoapSerializer.cpp	27 Jan 2005 08:32:37 -0000	1.90
  +++ SoapSerializer.cpp	28 Jan 2005 11:17:08 -0000	1.91
  @@ -250,6 +250,21 @@
       if(m_pSoapEnvelope)
       {
   		if (checkAttachmentAvailability()) {
  +
  +            string asStartID;
  +            string asSOAPMimeHeaders;
  +            asSOAPMimeHeaders   = pStream->getIncomingSOAPMimeHeaders();
  +            int start= asSOAPMimeHeaders.find("Content-Type");
  +            int startPosIdValue = asSOAPMimeHeaders.find ("<",start+strlen("Content-Id:"))+1;
  +            int endPosIdValue   = asSOAPMimeHeaders.find(">", start+strlen("Content-Type"));
  +            int length          = endPosIdValue - startPosIdValue ;
  +            asStartID           = asSOAPMimeHeaders.substr (startPosIdValue,length); 
  +        
  +            string * asContentType = new string("multipart/related; type=\"text/xml\";
start=\"<");
  +            *asContentType=*asContentType + asStartID + ">\"";
  +            *asContentType=*asContentType +";  boundary=\"------=MIME BOUNDARY\"";
  +            pStream->setTransportProperty(CONTENT_TYPE, (*asContentType).c_str()); 
  +
   			serialize("\n------=MIME BOUNDARY\n", NULL);
   			serialize(pStream->getIncomingSOAPMimeHeaders(), "\n\n", NULL);
   		}
  @@ -912,7 +927,7 @@
   
   int SoapSerializer::serializeAsChardata(void* pValue, XSDTYPE type)
   {
  -    const char* pStr = m_Buf;
  +    char* pStr = m_Buf;
       switch (type)
       {
       case XSD_INT:
  @@ -1031,7 +1046,8 @@
       case XSD_BASE64BINARY:
           {
               Base64Binary base64BinarySerializer;
  -            pStr = base64BinarySerializer.serialize(pValue);
  +            //pStr = base64BinarySerializer.serialize(pValue);
  +            strcpy(pStr, base64BinarySerializer.serialize(pValue));            
           }
           break;
       case XSD_DATETIME:
  
  
  

Mime
View raw message