axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Dick <adrian.d...@uk.ibm.com>
Subject Re: null character in binary data
Date Mon, 16 Jan 2006 10:12:42 GMT
Hi,

This area of code has been fixed since the release of 1.5

Can you try the latest 1.6 nightly driver (available at
http://cvs.apache.org/dist/axis/nightly)?

Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)


"Rick Jen" <RJen@cogentsystems.com> wrote on 14/01/2006 03:59:44:

> Hi,
>
> I’m using Axis c++  axis-c-1.5.0-linux-src to implement web service
> for my project to transfer binary data.
>
> In the wsdl, the data type is defined as “base64Binary”. But I found
> out that if there’s a null character in the binary data being
> transferred, it’s truncated after the null character. Then in my
> debug session I found that in src/soap/SoapSerializer.cpp, it uses
> strcpy() to handle the buffer:
>
> SoapSerializer::SoapSerializer()
> {
> ...skipping...
>     case XSD_BASE64BINARY:
>         if (pValue == NULL)
>         {
>             pParam->m_Value.b64bValue = NULL;
>         }
>         else
>         {
>             pParam->m_Value.b64bValue = new xsd__base64Binary;
>             pParam->m_Value.b64bValue->__size =
> (*((xsd__base64Binary *) (pValue))).__size;
>             pParam->m_Value.b64bValue->__ptr = new
> xsd__unsignedByte[pParam->m_Value.b64bValue->__size + 1];
> //             strcpy((char*)(pParam->m_Value.b64bValue->__ptr),
> (char*)(*((xsd__base64Binary *) (pValue))).__ptr);
>            memcpy((char*)(pParam->m_Value.b64bValue->__ptr), (char*)
> (*((xsd__base64Binary *) (pValue))).__ptr,
>            pParam->m_Value.b64bValue->__size);
>         }
>         break;
> ...skipping...
> }
>
> I tried memcpy instead and then it works fine.
>
> Thanks,
>
> - Rick
>
>
Mime
View raw message