Bug 983077

Summary: OGNLUtils.assertIsCollection() incorrectly interprets "Zero or more repetitions" comments in front of non-repeatable field
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Adam Kovari <akovari>
Component: JBossESBAssignee: tcunning
Status: ON_QA --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.3.1CC: nobody, nwallace, rwagner, soa-p-jira
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
- JBoss SOA-P 5.3.1
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 986007    
Attachments:
Description Flags
Reproducer none

Description Adam Kovari 2013-07-10 12:45:05 UTC
Created attachment 771588 [details]
Reproducer

Description of problem:
* Suppose you have a long WSDL document and only set one single parameter in the request map using OGNL, such as:
requestMap.put("mutiereGeschaeft.geschaeft.Kredit.KreStatus", "ssss");

* WSDL snippet:
     <xs:element name='KreStatus' nillable='true' type='xs:string'/>

* Generated Request - without parameters filed:
               <!--Zero or more repetitions: - cloned-->
               
               <java1:KreStatus>?</java1:KreStatus>


* org.jboss.internal.soa.esb.soap.OGNLUtils.assertIsCollection() checks for this:
            if(commentBefore != null 
                && (commentBefore.getTextContent().endsWith(SOAPUI_CLONE_COMMENT)
                    || commentBefore.getTextContent().endsWith(SOAPUI_CLONE_COMMENT + CLONED_POSTFIX))) {
                return true;
            }

which is true and this causes this parameter to not be filled at all. If 
mutiereGeschaeft.geschaeft.Kredit.KreStatus[0] is used, the parameter will be correctly filled.

We need to make sure that assertIsCollection(), possibly assertIsParentCollection() also checks if the element can be repeated, or somehow else make sure that we actually have repeated the element and not some other elements.


Version-Release number of selected component (if applicable):
- JBoss SOA-P 5.3.1

How reproducible:
Always


Steps to Reproduce:
1. Using attached modified quickstart

Actual results:
Variable not set.

Expected results:
Variable set.

Additional info:

Comment 1 JBoss JIRA Server 2013-07-24 17:01:41 UTC
Tom Cunningham <tcunning> updated the status of jira JBESB-3942 to Resolved

Comment 2 JBoss JIRA Server 2013-07-24 17:01:41 UTC
Tom Cunningham <tcunning> made a comment on jira JBESB-3942

When elements were being removed from the template in SoapUIClientService, the comments associated with that element were not being removed.    Make sure to remove comments when removing an element.

Comment 3 JBoss JIRA Server 2013-07-24 17:01:56 UTC
Tom Cunningham <tcunning> updated the status of jira JBESB-3942 to Closed

Comment 4 tcunning 2013-07-24 17:42:27 UTC
The issue doesn't seem to be with OGNLUtils.assertIsCollection, the issue seems to be with removing elements in SoapUIClientService - when removing elements, we were leaving behind comments associated to that element.