I have my input request as:
<body>
<p:UpdateID xmlns:p="http://tempuri.org">
<!--Exactly 1 occurrence-->
<xs:newid xmlns:xs="http://tempuri.org">NewID</xs:newid>
<!--1 or more occurrences-->
<xs:oldid xmlns:xs="http://tempuri.org">OldID_001</xs:oldid>
<xs:oldid xmlns:xs="http://tempuri.org">OldID_002</xs:oldid>
</p:UpdateID>
</body>
I have written a proxy service which i not working as:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="UpdateID" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<iterate xmlns:xs="http://tempuri.org" id="Iterate1" expression="count(//xs:oldid)">
<target>
<sequence>
<property name="newid" expression="//xs:newid" scope="default" type="STRING"/>
<property name="oldid" expression="//xs:oldid" scope="default" type="STRING"/>
<payloadFactory>
<format>
<p:UpdateID xmlns:p="http://tempuri.org">
<xs:newid>$1</xs:newid>
<xs:oldid>$2</xs:oldid>
</p:UpdateID>
</format>
<args>
<arg expression="get-property('newid')"/>
<arg expression="get-property('oldid')"/>
</args>
</payloadFactory>
<send>
<endpoint key="UpdateEP"/>
</send>
</sequence>
</target>
</iterate>
</inSequence>
</target>
<publishWSDL uri="http://xyz:9764/services/Update_DataService?wsdl"/>
<description></description>
</proxy>
Now my question is how can i get the count of oldid so that i can iterate from 0 to count of oldid,Something like for loop. And second how can i assign oldid value to the payload one by one . Please Help. Thanks in advance