Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-2574

OGNLUtils.assertIsCollection fails

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.5
    • Fix Version/s: 4.9
    • Component/s: Rosetta
    • Labels:
      None

      Description

      The method

          private static boolean assertIsCollection(Element element) {
              if(element.getAttributeNS(JBOSSESB_SOAP_NS, IS_COLLECTION_ATTRIB).equals("true")) {
                  // It's already been attributed... no need to check for the soapui comment...
                  return true;
              }
      
              Comment firstComment = (Comment) YADOMUtil.getFirstChildByType(element, Node.COMMENT_NODE);
      
              // TODO: Get Ole (soapUI) to add an attribute to the collection element - better than looking for this comment.
              if(firstComment != null && firstComment.getTextContent().indexOf("1 or more repetitions") != -1) {
                  return true;
              }
      
              return false;
          }
      

      Especially row;
      Comment firstComment = (Comment) YADOMUtil.getFirstChildByType(element, Node.COMMENT_NODE);
      is causing a grief.
      Given an WSDL like below;
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
      <soapenv:Header/>
      <soapenv:Body>
      <QueryRequest>
      <username>?</username>
      <password>?</password>
      <Customer id="?" telcoid="?"/>

      <!-1 or more repetitions:->
      <productIds>?</productIds>

      <isLookup>?</isLookup>
      <maxWaitTime>?</maxWaitTime>
      </QueryRequest>
      </soapenv:Body>
      </soapenv:Envelope>

      OGNLUtils creates ognlExpression QueryRequest[0] for all the elements below QueryRequest. E.g. ognl for username, password etc is "QueryRequest[0]" for username and also "QueryRequest[0]" for password, when in reality it should be QueryRequest.username , QueryRequest.password etc..

      This is caused by the array element LATER in the WSDL;
      <!-1 or more repetitions:->
      <productIds>?</productIds>
      combined with the Comment firstComment = (Comment) YADOMUtil.getFirstChildByType(element, Node.COMMENT_NODE); which somehow finds the "<!-- 1 or .." later in the wsdl.

      I think.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mageshbk Magesh Bojan
                  Reporter:
                  jjarkko Jarkko Lietolahti
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: