Bug 809065 - requst xml iteration using foreach is not working
requst xml iteration using foreach is not working
Status: CLOSED NOTABUG
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: riftsaw (Show other bugs)
5.2.0 GA
Unspecified Windows
unspecified Severity urgent
: ---
: ---
Assigned To: Gary Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-02 07:42 EDT by Ravi
Modified: 2012-04-12 04:12 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Dev
Last Closed: 2012-04-12 04:12:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
loopTestProject (4.58 KB, application/x-zip-compressed)
2012-04-02 07:43 EDT, Ravi
no flags Details

  None (edit)
Description Ravi 2012-04-02 07:42:43 EDT
Description of problem:
Unable to retrieve an element from a list using XPath 1.0in BPEL 2.0 using 'foreach' counter variable.

Version-Release number of selected component (if applicable):
SOA Platform 5.2.0 GA


How reproducible:
Attached the project

Steps to Reproduce:
1.Deploy loopTest project to SOA paltform 5.2.0 GA 
2.Test the wsdl 'http://localhost:8080/looptest?wsdl' in soap ui and test with loopTestReq.xml


3.  
Actual results:
Getting an error
<faultcode xmlns:valueNS="_http://docs.oasis-open.org/wsbpel/2.0/process/executable">valueNSelectionFailure</faultcode>

Expected results:
Should return 2nd element

Additional info:
I am trying to send a request (attached) with a employee-info list of zise 3.
Defined a foreach  loop like below
  <bpel:forEach parallel="no" counterName="Counter" name="ForEach">
            <bpel:startCounterValue><![CDATA[1]]></bpel:startCounterValue>
            <bpel:finalCounterValue><![CDATA[count($input.payload/tns:employee-list/tns:employee-info)]]></bpel:finalCounterValue>
       and trying to retrieve the 2nd element using below expression.
 <![CDATA[$input.payload/tns:employee-list/tns:employee-info[$Counter]/tns:emp-id]]>
Comment 1 Ravi 2012-04-02 07:43:24 EDT
Created attachment 574473 [details]
loopTestProject
Comment 2 Gary Brown 2012-04-02 11:12:17 EDT
Two suggestions,

1) Change the xpath expression to be:

<![CDATA[$input.payload/tns:employee-list/tns:employee-info[position()=$Counter]/tns:emp-id]]>


and if that does not work,

2) Try both variations with:

<bpelrocess name="..."
         ....
         queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublangpath2.0"
         expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublangpath2.0">


and remove any 'queryLanguage' attribute in the remainder of the process definition.


If you could let us know the results of these two suggestions.
Comment 3 Ravi 2012-04-12 00:30:56 EDT
Hi Gary,

Sorry for the delayed reply and thanks a lot for your suggestions.

The xpath expression with [position()=$Counter] and queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublangpath2.0"
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublangpath2.0"

is working fine.

Thanks,
Ravi
Comment 4 Gary Brown 2012-04-12 04:12:30 EDT
Ok thanks Ravi, I'll close this issue then.

Note You need to log in before you can comment on or make changes to this bug.