I have a following SOAP response :-
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<retrieveAllDataResponse xmlns="http://services.test.com/schema/MainData/V1">
<retrieveAllData>
<Response>The Data retrieved from the Database</Response>
<Id>1231</Id>
<Name>test1</Name>
<Age>560</Age>
<Designation>Software Engineer</Designation>
</retrieveAllData>
<retrieveAllData>
<Response>The Data retrieved from the Database</Response>
<Id>165</Id>
<Name>test2</Name>
<Age>561</Age>
<Designation>Senior Software Engineer</Designation>
</retrieveAllData>
<retrieveAllData>
<Response>The Data retrieved from the Database</Response>
<Id>134</Id>
<Name>test3</Name>
<Age>562</Age>
<Designation>HR</Designation>
</retrieveAllData>
</retrieveAllDataResponse>
</soap:Body>
</soap:Envelope>
Now I want to extract the values from the list <retrieveAllData>
and put into flow variables under foreach :-
<foreach collection="#[xpath('//xmlns:retrieveDataResponse/xmlns:retrieveAllData')]" doc:name="For Each">
<set-variable doc:name="Variable" value="#[xpath('//xmlns:Id/text()').text]" variableName="id"/>
<logger level="INFO" message="#[flowVars['id']]" doc:name="Logger"/>
<set-variable doc:name="Variable" value="#[xpath('//xmlns:Name/text()').text]" variableName="name"/>
<logger level="INFO" message="#[flowVars['name']]" doc:name="Logger"/>
<set-variable doc:name="Variable" value="#[xpath('//xmlns:Age/text()').text]" variableName="age"/>
<logger level="INFO" message="#[flowVars['age']]" doc:name="Logger"/>
<set-variable doc:name="Variable" value="#[xpath('//xmlns:Designation/text()').text]" variableName="designation"/>
But I am not getting the values into the variables.. I am getting the following :-
Splitter returned no results. If this is not expected, please check your split expression
Please note that I have already set XML namespace Manager for the namespace ..
Please let me know is there any better way to get all the values from the list and set it into the flow variables ?