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 Roshan Weerasuriya <ro...@opensource.lk> on 2004/06/10 08:19:40 UTC

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

hi James,

Ok, now I realize that there is a problem. Sorry that I have over looked it 
last time, when I send the reply to you. Ok, thanks for your feed back. I 
corrected it and commited it now.

Roshan



At 10:12 AM 6/8/2004 -0400, you wrote:
>Hi Roshan,
>
>When I reported the bug, I checked the version 1.54 (from CVS) for the bug.
>I just checked version 1.55(the latest version) and it still has the bug.
>
>The code/logic below does not work for "<tag>false</tag>":
>       ret = (0 == strcmp(m_pNode->m_pchNameOrValue, "true") ||
>              0 != strcmp(m_pNode->m_pchNameOrValue, "0" ))
>              ? true_: false_;
>
>Regards,
>
>James
>
>
>
> 
>
>                       Roshan 
 >
>                       Weerasuriya              To:       "Apache AXIS C 
> Developers List" <ax...@ws.apache.org>
>                       <roshan@opensourc        cc: 
> james_guido@homedepot.com
>                       e.lk>                    Subject:  Re: [jira] 
> Created: (AXISCPP-95) Boolean Deserializer when it
>                                                 encounters 
> "<tag>false</tag>" returns 1(true), instead of 0(false)
>                       06/08/2004 
> 12:00 
>
>                       AM 
 >
> 
>
> 
>
>
>
>
>
>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