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]]>
Created attachment 574473 [details] loopTestProject
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.
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
Ok thanks Ravi, I'll close this issue then.