Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.63 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <api context="/test" name="test" xmlns="http://ws.apache.org/ns/synapse">
  3. <resource methods="GET">
  4. <inSequence>
  5. <property name="ROOT" scope="default">
  6. <root:movie xmlns:root="www.wso2esb.com"/>
  7. </property>
  8. <property name="uri.var.id" scope="default" type="STRING" value="tt0418279"/>
  9. <dbreport description="">
  10. <connection>
  11. <pool>
  12. <password>regadmin</password>
  13. <driver>com.mysql.jdbc.Driver</driver>
  14. <url>jdbc:mysql://localhost:3306/regdb</url>
  15. <user>regadmin</user>
  16. </pool>
  17. </connection>
  18. <statement>
  19. <sql><![CDATA[insert into tracker (`id`, `query`, `tracked`) values (NULL, ?, NOW())]]></sql>
  20. <parameter expression="get-property('uri.var.id')" type="VARCHAR"/>
  21. </statement>
  22. </dbreport>
  23. <clone continueParent="true" id="movie" sequential="true">
  24. <target>
  25. <sequence>
  26. <send>
  27. <endpoint>
  28. <http format="rest" uri-template="http://api.themoviedb.org/3/movie/{uri.var.id}?api_key=92da40753f9bdf6c0206ea410bb10e72&amp;append_to_response=casts,images"/>
  29. </endpoint>
  30. </send>
  31. </sequence>
  32. </target>
  33. <target>
  34. <sequence>
  35. <send>
  36. <endpoint>
  37. <http format="rest" uri-template="https://www.omdbapi.com/?type=movie&amp;i={uri.var.id}"/>
  38. </endpoint>
  39. </send>
  40. </sequence>
  41. </target>
  42. </clone>
  43. </inSequence>
  44. <outSequence>
  45. <aggregate id="movie">
  46. <completeCondition>
  47. <messageCount max="-1" min="-1"/>
  48. </completeCondition>
  49. <onComplete enclosingElementProperty="ROOT" expression="//jsonObject/*" xmlns:dummy="http://org.dummy" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  50. <property expression="/soapenv:Envelope/soapenv:Body/root:movie/belongs_to_collection/id" name="collection" scope="default" type="STRING"/>
  51. <log level="custom">
  52. <property expression="get-property('collection')" name="INCOMING"/>
  53. </log>
  54. <filter description="" regex="[0-9]+" source="get-property('collection')">
  55. <then>
  56. <log level="custom">
  57. <property name="STATUS" value="COLLECTION"/>
  58. </log>
  59. </then>
  60. <else>
  61. <log level="custom">
  62. <property name="STATUS" value="NOT COLLECTION"/>
  63. </log>
  64. <datamapper config="gov:datamapper/TestMapping.dmc" inputSchema="gov:datamapper/TestMapping_inputSchema.json" inputType="XML" outputSchema="gov:datamapper/TestMapping_outputSchema.json" outputType="XML"/>
  65. </else>
  66. </filter>
  67. <respond/>
  68. </onComplete>
  69. </aggregate>
  70. </outSequence>
  71. <faultSequence/>
  72. </resource>
  73. </api>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement