axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Giorgio Saviane (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Created: (AXISCPP-615) Wrong serialization for type XSD_BASE64BINARY
Date Fri, 15 Apr 2005 15:58:16 GMT
Wrong serialization for type XSD_BASE64BINARY
---------------------------------------------

         Key: AXISCPP-615
         URL: http://issues.apache.org/jira/browse/AXISCPP-615
     Project: Axis-C++
        Type: Bug
  Components: Serialization  
    Versions: 1.5 Final    
 Environment: Win32 (maybe Linux too)
    Reporter: Giorgio Saviane
    Priority: Blocker


The XSD_BASE64BINARY is wrongly copied when you add a parameter on a client call to a WS.
A XSD_BASE64BINARY is treated as a string instead as a memory block in SoapSerializer::addOutputParam
method. In line 970 I've found the statement:
            strcpy((char*)(pParam->m_Value.b64bValue->__ptr), (char*)(*((xsd__base64Binary
*) (pValue))).__ptr);
and should be:
            memcpy((char*)(pParam->m_Value.b64bValue->__ptr), (char*)(*((xsd__base64Binary
*) (pValue))).__ptr, pParam->m_Value.b64bValue->__size);

otherwise the copy will stopped at the first null value. Applying that patch the call works
fine.

Steps to reproduce the bug
==========================
Expose on the server a WS with a method that accepts a binary memory block as parameter (a
Java byte[]). Create the wsdl and a C++ client prototype with the tool:
%JAVA_HOME%\bin\java -classpath %AXIS_C_HOME%\lib\axis\wsdl2ws.jar;%AXISCLASSPATH% org.apache.axis.wsdl.wsdl2ws.WSDL2Ws
%1 -o./ClientOut -lc++ -sclient class.wsdl

Complete the client call pasting some chunks of binary data on the parameter, whit a 0 value
on the middle (e.g.: "abcd\0x00defg"). Compile the C++ client and run it, the server will
receive correcltly the left side of the string preceding the 0, the other side will be undefined.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message