Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1492

maximum value of xsd:unsignedInt cannot exceed maximum value of signed integer (2147483647)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.0
    • None
    • code generation
    • None

    Description

      Deserialize functionality for xsd:unsignedInt values is done via atoi() function. Here is an example of the generated code for unsignedInt element:
      text_value = axiom_element_get_text(current_element, env, current_node);
      if(text_value != NULL)
      {
      status = adb_clientClass_set_priority(_clientClass, env,
      atoi(text_value));
      }

      Here is how that element is defined in XSD file:
      <xsd:element name="priority" type="xsd:unsignedInt">
      ...
      </xsd:element

      Unfortunately atoi is returning int (signed integer) and as a result whenever the value for that unsignedInt element is set to be large than the maximum value for SIGNED integer (larger than 2147483647) it is decreased to 2147483647, while the maximum value for unsignedInt should be 4294967295.
      Once the atoi() in generated code is replaced with strtoul() the problem is gone.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mindeeva Maria Indeeva
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: