Hi Dhanya, Could you update your expression with namespace prefix? Something similar to following works.
<iterate xmlns:m0="http://ws.apache.org/ns/synapse" continueParent="true" expression="//m0:node1" id="ENTRY_ITERATOR"> Thanks, Himasha On Mon, Feb 5, 2018 at 2:01 PM, dhanya <dhanyasanth2...@gmail.com> wrote: > Hi, > > I am using wso2 integrator and facing an issue while trying to use the > iterator mediator. > My requirement is to iterate using a node in the xml and use the resulting > split value to create new files in a folder. > I have created a sample proxy file as follows: > > <?xml version="1.0" encoding="UTF-8"?> > <proxy name="iFlightLiteRecieve" startOnLoad="true" transports="https http" > xmlns="http://ws.apache.org/ns/synapse"> > <target> > <inSequence><payloadFactory description="Payload" media-type="xml"> > <format><node1> > <node>hi</node> > <node>hi1</node> > </node1> > </format> > <args> > <arg evaluator="xml" > expression="get-property('mediatorPayload')"/> > </args> > </payloadFactory> > <log level="full"> > <property name="property_name" > value=""AfterPayloadFactory:""/> > </log> > <iterate xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > continueParent="true" expression="//soapenv:Envelope/node1" > xmlns="http://ws.apache.org/ns/synapse" id="ENTRY_ITERATOR" > > <target> > <sequence> > <log level="full"> > <property name="property_name2" > value=""Iterated:""/> > </log> > </sequence> > <endpoint> > <address uri="vfs:file:///D:/Sample"/> > </endpoint> > </target> > </iterate> > </inSequence> > <outSequence> > <send/> > </outSequence> > <faultSequence> > <send/> > </faultSequence> > </target> > </proxy> > > > sample XML: > > <?xml version='1.0' encoding='utf-8'?> > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ > "> > <soapenv:Body> > <node1 xmlns="http://ws.apache.org/ns/synapse"> > <node>hi</node> > <node>hi1</node> > </node1> > </soapenv:Body> > </soapenv:Envelope> > > Based on the above xml i would like to split the file on <node> to get the > values hi, and hi1. Then create 2 files in the mentioned folder ( one file > having value hi and another file having value hi1). > > However the iterate block is not getting invoked since the logs are not > getting printed from within the iterate mediator. > What could be wrong here? > > Thanks and Regards > Dhanya > > > > -- > Sent from: http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2- > Development-f3.html > _______________________________________________ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Himasha Guruge Senior Software Engineer WS*O2* *Inc.* Mobile: +94 777459299 himas...@wso2.com
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev