Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 99359 invoked from network); 19 Aug 2005 14:03:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Aug 2005 14:03:18 -0000 Received: (qmail 4206 invoked by uid 500); 19 Aug 2005 14:03:15 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 4117 invoked by uid 500); 19 Aug 2005 14:03:15 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 4059 invoked by uid 99); 19 Aug 2005 14:03:14 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 07:03:14 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 62BC5E2 for ; Fri, 19 Aug 2005 16:03:13 +0200 (CEST) Message-ID: <1892558292.1124460193381.JavaMail.jira@ajax.apache.org> Date: Fri, 19 Aug 2005 16:03:13 +0200 (CEST) From: "Adrian Dick (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Commented: (AXISCPP-788) AXIS C++ allows to set positive values to XSD_negativeInteger type In-Reply-To: <1500367216.1123498054993.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXISCPP-788?page=3Dcomments#acti= on_12319381 ]=20 Adrian Dick commented on AXISCPP-788: ------------------------------------- There seems to be some misunderstanding on what goes on with negativeIntege= r and nonPositiveInteger. Within AxisUserAPI.hpp these two types are declared as unsigned LONGLONG (= 64bit integer), so it isn't possible to provide a signed negative value as = you will get an unexpectedly large unsigned value( as seen in case 2. of t= he original description). Also, as a result of this, the recently introduc= ed code in the constructors, below, will fail for all values except 0 (if c= ompiler treats as signed) or all values over 18446744073709551615 (is comp= iler treats as unsigned) : if(valueToCheck > -1) throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "PositiveInt= eger value must be minus one or less"); As I see it, there are two possible fixes: 1) Improve the API documentation within AxisUserAPI.hpp to make it clear t= hat xsd__negativeInteger is an unsigned value that is implicitly negative. 2) Modify xsd__negativeInteger to be a signed LONGLONG, and make some mino= r modifications to the checks for Max/Min Inclusive/Exclusive (which curren= tly assume negative unsigned integer). In either case, the recently introduced checks within the constructor are n= ot required because this is already carried out within the serialize method= (which is invoked as part of the object constructor) For the second case, we will loose 1/2 our potential value space -- but oth= ers may not see this as a big issue. Adrian > AXIS C++ allows to set positive values to XSD_negativeInteger type > ------------------------------------------------------------------- > > Key: AXISCPP-788 > URL: http://issues.apache.org/jira/browse/AXISCPP-788 > Project: Axis-C++ > Type: Bug > Reporter: Manohar > Assignee: Samisa Abeysinghe > Fix For: 1.6 Alpha > > Axis C++ allows to set positive values for XSD_negativeInteger dataype. = As per the XML schema specification, the =C2=B7value space=C2=B7 of negativ= eInteger is the infinite set {...,-2,-1} and it's maxInclusive is -1. This= means, only negagtive integer values should be allowed and no positive val= ues. But, I see that positive values can also be set for this datatype. As = per my observation, > 1. negativeInteger and nonPositiveInteger types accept positive values = ( e.g. +1 is accepted and same value is displayed after serialze/deseriali= zed) > 2. positiveInteger and nonNegativeInteger types accept negative values ( = e.g. -1 is accepted and 18446744073709551615 value is displayed after=20 > serialze/deserialized) > I think this is not the correct behaviour. Though these XML datatypes are= mapped to different datatypes of client programming languages (C/C++ in ou= r case), this should not be allowed while serializing/deserializing in the = client product and some exception should be reported indicating the error. = I see the whole purpose of a datatype is lost when a +ve value is set for = a negativeInteger type and vice versa. > Testcases written for these types ( XSD_negativeIntegerClient.cpp, XSD_no= nPositiveIntegerClient.cpp, XSD_positiveIntegerClient.cpp and XSD_nonNegati= veIntegerClient.cpp) show this problem.=20 > Regards > Manohar. --=20 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 - For more information on JIRA, see: http://www.atlassian.com/software/jira