Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <api context="/test" name="test" xmlns="http://ws.apache.org/ns/synapse">
- <resource methods="GET">
- <inSequence>
- <property name="ROOT" scope="default">
- <root:movie xmlns:root="www.wso2esb.com"/>
- </property>
- <property name="uri.var.id" scope="default" type="STRING" value="tt0418279"/>
- <dbreport description="">
- <connection>
- <pool>
- <password>regadmin</password>
- <driver>com.mysql.jdbc.Driver</driver>
- <url>jdbc:mysql://localhost:3306/regdb</url>
- <user>regadmin</user>
- </pool>
- </connection>
- <statement>
- <sql><![CDATA[insert into tracker (`id`, `query`, `tracked`) values (NULL, ?, NOW())]]></sql>
- <parameter expression="get-property('uri.var.id')" type="VARCHAR"/>
- </statement>
- </dbreport>
- <clone continueParent="true" id="movie" sequential="true">
- <target>
- <sequence>
- <send>
- <endpoint>
- <http format="rest" uri-template="http://api.themoviedb.org/3/movie/{uri.var.id}?api_key=92da40753f9bdf6c0206ea410bb10e72&append_to_response=casts,images"/>
- </endpoint>
- </send>
- </sequence>
- </target>
- <target>
- <sequence>
- <send>
- <endpoint>
- <http format="rest" uri-template="https://www.omdbapi.com/?type=movie&i={uri.var.id}"/>
- </endpoint>
- </send>
- </sequence>
- </target>
- </clone>
- </inSequence>
- <outSequence>
- <aggregate id="movie">
- <completeCondition>
- <messageCount max="-1" min="-1"/>
- </completeCondition>
- <onComplete enclosingElementProperty="ROOT" expression="//jsonObject/*" xmlns:dummy="http://org.dummy" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <property expression="/soapenv:Envelope/soapenv:Body/root:movie/belongs_to_collection/id" name="collection" scope="default" type="STRING"/>
- <log level="custom">
- <property expression="get-property('collection')" name="INCOMING"/>
- </log>
- <filter description="" regex="[0-9]+" source="get-property('collection')">
- <then>
- <log level="custom">
- <property name="STATUS" value="COLLECTION"/>
- </log>
- </then>
- <else>
- <log level="custom">
- <property name="STATUS" value="NOT COLLECTION"/>
- </log>
- <datamapper config="gov:datamapper/TestMapping.dmc" inputSchema="gov:datamapper/TestMapping_inputSchema.json" inputType="XML" outputSchema="gov:datamapper/TestMapping_outputSchema.json" outputType="XML"/>
- </else>
- </filter>
- <respond/>
- </onComplete>
- </aggregate>
- </outSequence>
- <faultSequence/>
- </resource>
- </api>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement