You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/08/12 06:54:18 UTC

cvs commit: ws-axis/c/src/soap/xsd NegativeInteger.cpp NegativeInteger.hpp NonNegativeInteger.cpp NonNegativeInteger.hpp NonPositiveInteger.cpp NonPositiveInteger.hpp PositiveInteger.cpp PositiveInteger.hpp

samisa      2005/08/11 21:54:18

  Modified:    c/src/soap/xsd NegativeInteger.cpp NegativeInteger.hpp
                        NonNegativeInteger.cpp NonNegativeInteger.hpp
                        NonPositiveInteger.cpp NonPositiveInteger.hpp
                        PositiveInteger.cpp PositiveInteger.hpp
  Log:
  Added logic to throw an exception in case of invalid values.
  
  AXISCPP-788
  
  Revision  Changes    Path
  1.5       +3 -1      ws-axis/c/src/soap/xsd/NegativeInteger.cpp
  
  Index: NegativeInteger.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NegativeInteger.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NegativeInteger.cpp	1 Jun 2005 14:22:56 -0000	1.4
  +++ NegativeInteger.cpp	12 Aug 2005 04:54:18 -0000	1.5
  @@ -20,10 +20,12 @@
   NegativeInteger::NegativeInteger()
   {}
   
  -NegativeInteger::NegativeInteger(const xsd__negativeInteger* value)
  +NegativeInteger::NegativeInteger(const xsd__negativeInteger* value) throw (AxisSoapException)
   {
       if (value)
       {
  +        if((*value) > -1) // the value must be minus one or less, hence validate and fix
  +            throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "PositiveInteger value must be minus one or less");
           setNil(false);
           serialize(value);
       }
  
  
  
  1.5       +1 -1      ws-axis/c/src/soap/xsd/NegativeInteger.hpp
  
  Index: NegativeInteger.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NegativeInteger.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NegativeInteger.hpp	1 Jun 2005 14:22:56 -0000	1.4
  +++ NegativeInteger.hpp	12 Aug 2005 04:54:18 -0000	1.5
  @@ -35,7 +35,7 @@
       /**
        * Constructor
        */
  -    NegativeInteger();
  +    NegativeInteger() throw (AxisSoapException);
       
       /**
        * Constructor providing a value for later serialization
  
  
  
  1.15      +3 -1      ws-axis/c/src/soap/xsd/NonNegativeInteger.cpp
  
  Index: NonNegativeInteger.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NonNegativeInteger.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- NonNegativeInteger.cpp	4 Jul 2005 16:43:58 -0000	1.14
  +++ NonNegativeInteger.cpp	12 Aug 2005 04:54:18 -0000	1.15
  @@ -21,10 +21,12 @@
   {
   }
   
  -NonNegativeInteger::NonNegativeInteger(const xsd__nonNegativeInteger* value)
  +NonNegativeInteger::NonNegativeInteger(const xsd__nonNegativeInteger* value) throw (AxisSoapException)
   {
       if (value)
       {
  +        if((*value) < 0) // the value must be non negative, hence validate and fix
  +            throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "NonNegativeInteger value must be non negative");
           setNil(false);
           serialize(value);
       }
  
  
  
  1.10      +1 -1      ws-axis/c/src/soap/xsd/NonNegativeInteger.hpp
  
  Index: NonNegativeInteger.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NonNegativeInteger.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- NonNegativeInteger.hpp	1 Jun 2005 14:22:56 -0000	1.9
  +++ NonNegativeInteger.hpp	12 Aug 2005 04:54:18 -0000	1.10
  @@ -46,7 +46,7 @@
        * Constructor providing a value for later serialization
        * @param value The value to be serialized
        */
  -    NonNegativeInteger(const xsd__nonNegativeInteger* value);
  +    NonNegativeInteger(const xsd__nonNegativeInteger* value) throw (AxisSoapException);
   
       /**
        * Get the xsd type of this simple type.
  
  
  
  1.11      +3 -1      ws-axis/c/src/soap/xsd/NonPositiveInteger.cpp
  
  Index: NonPositiveInteger.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NonPositiveInteger.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- NonPositiveInteger.cpp	5 Jul 2005 14:50:30 -0000	1.10
  +++ NonPositiveInteger.cpp	12 Aug 2005 04:54:18 -0000	1.11
  @@ -21,10 +21,12 @@
   {
   }
   
  -NonPositiveInteger::NonPositiveInteger(const xsd__nonPositiveInteger* value)
  +NonPositiveInteger::NonPositiveInteger(const xsd__nonPositiveInteger* value) throw (AxisSoapException)
   {
       if (value)
       {
  +        if((*value) > 0) // the value must be non positive, hence validate and fix
  +            throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "NonPositiveInteger value must be non positive");
           setNil(false);
           serialize(value);
       }
  
  
  
  1.5       +1 -1      ws-axis/c/src/soap/xsd/NonPositiveInteger.hpp
  
  Index: NonPositiveInteger.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/NonPositiveInteger.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NonPositiveInteger.hpp	1 Jun 2005 14:22:56 -0000	1.4
  +++ NonPositiveInteger.hpp	12 Aug 2005 04:54:18 -0000	1.5
  @@ -41,7 +41,7 @@
        * Constructor providing a value for later serialization
        * @param value The value to be serialized
        */
  -    NonPositiveInteger(const xsd__nonPositiveInteger* value);
  +    NonPositiveInteger(const xsd__nonPositiveInteger* value) throw (AxisSoapException);
       
       /**
        * Destructor
  
  
  
  1.5       +3 -1      ws-axis/c/src/soap/xsd/PositiveInteger.cpp
  
  Index: PositiveInteger.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/PositiveInteger.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PositiveInteger.cpp	1 Jun 2005 14:22:56 -0000	1.4
  +++ PositiveInteger.cpp	12 Aug 2005 04:54:18 -0000	1.5
  @@ -20,10 +20,12 @@
   PositiveInteger::PositiveInteger()
   {}
   
  -PositiveInteger::PositiveInteger(const xsd__positiveInteger* value)
  +PositiveInteger::PositiveInteger(const xsd__positiveInteger* value) throw (AxisSoapException)
   {
       if (value)
       {
  +        if((*value) < 1) // the value must be one or greater, hence validate and fix
  +            throw AxisSoapException(CLIENT_SOAP_SOAP_CONTENT_ERROR, "PositiveInteger value must be one or greater");
           setNil(false);
           serialize(value);
       }
  
  
  
  1.5       +1 -1      ws-axis/c/src/soap/xsd/PositiveInteger.hpp
  
  Index: PositiveInteger.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/xsd/PositiveInteger.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PositiveInteger.hpp	1 Jun 2005 14:22:56 -0000	1.4
  +++ PositiveInteger.hpp	12 Aug 2005 04:54:18 -0000	1.5
  @@ -35,7 +35,7 @@
       /**
        * Constructor
        */
  -    PositiveInteger();
  +    PositiveInteger() throw (AxisSoapException);
   
       /**
        * Constructor providing a value for later serialization