[ 
http://issues.apache.org/jira/browse/AXISCPP-788?page=comments#action_12319381 
] 

Adrian Dick commented on AXISCPP-788:
-------------------------------------

There seems to be some misunderstanding on what goes on with negativeInteger 
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 the 
original description).  Also, as a result of this, the recently introduced code 
in the constructors, below, will fail for all values except 0 (if compiler 
treats as signed) or all values over 18446744073709551615  (is compiler treats 
as unsigned) :
   if(valueToCheck > -1)
       throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "PositiveInteger 
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 that 
xsd__negativeInteger is an unsigned value that is implicitly negative.
2)  Modify xsd__negativeInteger to be a signed LONGLONG, and make some minor 
modifications to the checks for Max/Min Inclusive/Exclusive (which currently 
assume negative unsigned integer).

In either case, the recently introduced checks within the constructor are not 
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 others 
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 ·value space· of negativeInteger is the 
> infinite set {...,-2,-1}  and it's maxInclusive is -1. This means, only 
> negagtive integer values should be allowed and no positive values. 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/deserialized)
> 2. positiveInteger and nonNegativeInteger types accept negative values ( e.g. 
>  -1 is accepted and 18446744073709551615 value is displayed after 
>      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 our 
> 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_nonPositiveIntegerClient.cpp, XSD_positiveIntegerClient.cpp and 
> XSD_nonNegativeIntegerClient.cpp)  show this problem. 
> Regards
> Manohar.

-- 
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

Reply via email to