You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by ji...@apache.org on 2004/06/03 15:37:53 UTC

[jira] Created: (AXISCPP-95) Boolean Deserializer when it encounters "false" returns 1(true), instead of 0(false)

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXISCPP-95

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXISCPP-95
    Summary: Boolean Deserializer when it encounters "<tag>false</tag>" returns 1(true), instead of 0(false)
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis-C++
 Components: 
             Serialization/Deserialization
   Versions:
             unspecified

   Assignee: 
   Reporter: James Guido

    Created: Thu, 3 Jun 2004 6:37 AM
    Updated: Thu, 3 Jun 2004 6:37 AM
Environment: HP-UX 11.0 with gcc (Axis C++ 1.1.1)

Description:
Bug in de-serializer logic for processing boolean in GetElementAsBoolean method in SoapDeSerializer class.

The current logic behaves as follow:

XML               Boolean(int) returned by GetElementAsBoolean()    
<tag>true</tag>    1
<tag>false</tag>   1  (BUG, it should return 0)
<tag>0</tag>       0
<tag>1</tag>       1
<tag>5</tag>       1


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


Re: [jira] Created: (AXISCPP-95) Boolean Deserializer when it encounters "false" returns 1(true), instead of 0(false)

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi James,

Which version of Axis C++ are you using?

I could remember that there was this issue which you point out, but as I 
can remember It was fiexed. I checked the lates CVS code, and found that 
this problem doesn't exist. (I guess this might have been fixed in the 
lates CVS code).

The lates CVS code, getElementAsBoolean() method is as following.:

xsd__boolean SoapDeSerializer::getElementAsBoolean(const AxisChar* pName,
                                                    const AxisChar* pNamespace)
{
     xsd__boolean ret = false_;
     if (AXIS_SUCCESS != m_nStatus) return ret;
     if (RPC_ENCODED == m_nStyle)
     {
         m_pNode = m_pParser->next();
         /* wrapper node with type info  Ex: <i xsi:type="xsd:int">*/
         if (!m_pNode) return ret;
         if (XSD_BOOLEAN == getXSDType(m_pNode))
         {
             m_pNode = m_pParser->next(true); /* charactor node */
             if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
             {
                 ret = (0 == strcmp(m_pNode->m_pchNameOrValue, "true"))
                     ? true_: false_;
                 m_pNode = m_pParser->next(); /* skip end element node too */
                 return ret;
             }
         }
         else
         {
             /* it is an error if type is different or not present */
         }
     }
     else
     {
         if (!m_pNode)
             /* if there is an unprocessed node that may be one left from last
              * array deserialization
              */
             m_pNode = m_pParser->next();
             /* wrapper node without type info  Ex: <i>*/
         if (!m_pNode) return ret;
         if (0 == strcmp(pName, m_pNode->m_pchNameOrValue))
         {
             m_pNode = m_pParser->next(true); /* charactor node */
             if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
             {
                 /* Some web services server returns 1 */
                 ret = (0 == strcmp(m_pNode->m_pchNameOrValue, "true") ||
                     0 != strcmp(m_pNode->m_pchNameOrValue, "0" ))
                     ? true_: false_;
                 m_pNode = m_pParser->next(); /* skip end element node too */
                 m_pNode = NULL;
                 /* this is important in doc/lit style when deserializing
                  * arrays
                  */
                 return ret;
             }
             else
             {
                 /* simpleType may have xsi:nill="true" */
                 m_pNode = NULL;
                 /* this is important in doc/lit style when deserializing
                  * arrays
                  */
                 return ret;
             }
         }
         else
         {
             return ret;
             /* Not a must : m_nStatus = AXIS_FAIL; unexpected SOAP stream */
         }
     }
     m_nStatus = AXIS_FAIL; /* unexpected SOAP stream */
     return ret;
}

rgds,
Roshan

At 06:37 AM 6/3/2004 -0700, you wrote:
>Message:
>
>   A new issue has been created in JIRA.
>
>---------------------------------------------------------------------
>View the issue:
>   http://issues.apache.org/jira/browse/AXISCPP-95
>
>Here is an overview of the issue:
>---------------------------------------------------------------------
>         Key: AXISCPP-95
>     Summary: Boolean Deserializer when it encounters "<tag>false</tag>" 
> returns 1(true), instead of 0(false)
>        Type: Bug
>
>      Status: Unassigned
>    Priority: Major
>
>     Project: Axis-C++
>  Components:
>              Serialization/Deserialization
>    Versions:
>              unspecified
>
>    Assignee:
>    Reporter: James Guido
>
>     Created: Thu, 3 Jun 2004 6:37 AM
>     Updated: Thu, 3 Jun 2004 6:37 AM
>Environment: HP-UX 11.0 with gcc (Axis C++ 1.1.1)
>
>Description:
>Bug in de-serializer logic for processing boolean in GetElementAsBoolean 
>method in SoapDeSerializer class.
>
>The current logic behaves as follow:
>
>XML               Boolean(int) returned by GetElementAsBoolean()
><tag>true</tag>    1
><tag>false</tag>   1  (BUG, it should return 0)
><tag>0</tag>       0
><tag>1</tag>       1
><tag>5</tag>       1
>
>
>---------------------------------------------------------------------
>JIRA INFORMATION:
>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




[jira] Closed: (AXISCPP-95) Boolean Deserializer when it encounters "false" returns 1(true), instead of 0(false)

Posted by ax...@ws.apache.org.
Message:

   The following issue has been closed.

   Resolver: Samisa Abeysinghe
       Date: Thu, 7 Oct 2004 11:41 PM

Someone has fixed this.
It returns 0 for "false" and 1 for "true".
(in fact the logic used return 1 iff the bool tag contains "true" and returns 0 if bool tag does not contain "true")
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXISCPP-95

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXISCPP-95
    Summary: Boolean Deserializer when it encounters "<tag>false</tag>" returns 1(true), instead of 0(false)
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: Axis-C++
 Components: 
             Serialization/Deserialization
   Fix Fors:
             1.3 Final
   Versions:
             unspecified

   Assignee: Samisa Abeysinghe
   Reporter: James Guido

    Created: Thu, 3 Jun 2004 6:37 AM
    Updated: Thu, 7 Oct 2004 11:41 PM
Environment: HP-UX 11.0 with gcc (Axis C++ 1.1.1)

Description:
Bug in de-serializer logic for processing boolean in GetElementAsBoolean method in SoapDeSerializer class.

The current logic behaves as follow:

XML               Boolean(int) returned by GetElementAsBoolean()    
<tag>true</tag>    1
<tag>false</tag>   1  (BUG, it should return 0)
<tag>0</tag>       0
<tag>1</tag>       1
<tag>5</tag>       1


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


[jira] Updated: (AXISCPP-95) Boolean Deserializer when it encounters "false" returns 1(true), instead of 0(false)

Posted by ji...@apache.org.
The following issue has been updated:

    Updater: James Guido (mailto:james_guido@homedepot.com)
       Date: Thu, 3 Jun 2004 6:39 AM
    Comment:
Proposed bug fix (diff with version 1.54)
    Changes:
             Attachment changed to SoapDeSerializer.cpp.diff
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/AXISCPP-95?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXISCPP-95

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXISCPP-95
    Summary: Boolean Deserializer when it encounters "<tag>false</tag>" returns 1(true), instead of 0(false)
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: Axis-C++
 Components: 
             Serialization/Deserialization
   Versions:
             unspecified

   Assignee: 
   Reporter: James Guido

    Created: Thu, 3 Jun 2004 6:37 AM
    Updated: Thu, 3 Jun 2004 6:39 AM
Environment: HP-UX 11.0 with gcc (Axis C++ 1.1.1)

Description:
Bug in de-serializer logic for processing boolean in GetElementAsBoolean method in SoapDeSerializer class.

The current logic behaves as follow:

XML               Boolean(int) returned by GetElementAsBoolean()    
<tag>true</tag>    1
<tag>false</tag>   1  (BUG, it should return 0)
<tag>0</tag>       0
<tag>1</tag>       1
<tag>5</tag>       1


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