Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4911

wsdl2js generated code does not parse type when itterating through array (maxOccur) arrays

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.3
    • None
    • JavaScript Client
    • cxf 2.73, windows 7, custom soap server/wsdl generator (WS-I compliant)

    • Unknown

    Description

      rpc/literal WSDL

      section of WSDL:

      <xsd:complexType name="tdGL0Data">
      <xsd:sequence>
      <xsd:element name="syncIsrCount" minOccurs="1" maxOccurs="1" type="xsd:unsignedInt"/>
      <xsd:element name="GroupSize" minOccurs="1" maxOccurs="1" type="xsd:unsignedInt"/>
      <xsd:element name="LNdata" minOccurs="512" maxOccurs="512" type="xsd:short"/>
      </xsd:sequence>
      </xsd:complexType>

      The generated deserializer for the LNdata element is:

      cxfjsutils.trace('processing LNdata');
      if (curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'LNdata')) {
      item = [];
      do {
      var arrayItem = null;
      var value = null;
      if (!cxfjsutils.isElementNil(curElement))

      { value = cxfjsutils.getNodeText(curElement); arrayItem = value; }

      item.push(arrayItem);
      curElement = cxfjsutils.getNextElementSibling(curElement);
      }
      while(curElement != null && cxfjsutils.isNodeNamedNS(curElement, '', 'LNdata'));
      newobject.setLNdata(item);
      var item = null;
      }
      return
      }

      the lines:
      value = cxfjsutils.getNodeText(curElement);
      arrayItem = value;

      simply extract the data from the dom and place it directly in into the output array.

      The element was declared as a short, however the parseInt() call was not present in the generated code.

      note: there is no issue with the schema... xsd:unsignedInt was handled in the above 2 cases without issue

      Attachments

        1. XMLFile1.xml
          26 kB
          Stephen Muccione

        Activity

          People

            Unassigned Unassigned
            smuccione Stephen Muccione
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: