axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshan Weerasuriya <ros...@opensource.lk>
Subject Bug in serializeAsChardata with new xsd types [was Re: cvs commit: ws-axis/c/src/soap SoapSerializer.cpp]
Date Fri, 28 Jan 2005 11:51:40 GMT
hi All,

>   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:

I also came accross this problem. The moment it finishes this case block
of XSD_BASE64BINARY , the value of pStr became garbage. I think Rangika
has corrected this. Also I think may be it is the same for all the other
types under this method.

Is this change done by Rangika OK, who ever did work on this new xsd
types, might know the exact reason for this. When I debug it goes inside
the new xsd Base64.., IAnyType.. and the moment it finishes and the
moment it finishes this case block the value of pStr become garbage.

Roshan

On Fri, 2005-01-28 at 17:17, rangika@apache.org wrote:
> 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