Bug 809065 - requst xml iteration using foreach is not working
Summary: requst xml iteration using foreach is not working
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: riftsaw
Version: 5.2.0 GA
Hardware: Unspecified
OS: Windows
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Gary Brown
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-02 11:42 UTC by Ravi
Modified: 2012-04-12 08:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Dev
Last Closed: 2012-04-12 08:12:30 UTC
Type: Bug
Embargoed:


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

Description Ravi 2012-04-02 11:42:43 UTC
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 11:43:24 UTC
Created attachment 574473 [details]
loopTestProject

Comment 2 Gary Brown 2012-04-02 15:12:17 UTC
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 04:30:56 UTC
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 08:12:30 UTC
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.