Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <payloadFactory media-type="json">
  2. <format>{
  3. "accountId":$1,
  4. "ammount":$ctx:finalAmount
  5. }</format>
  6. <args>
  7. <arg evaluator="json" expression="$.accountTo"/>
  8. </args>
  9. </payloadFactory>
  10. <log level="full">
  11. <property name="message" value="start calling api full logs"/>
  12. </log>
  13. <call>
  14. <endpoint>
  15. <http format="rest" method="POST" uri-template="http://10.5.222.192:8282/updateAccountAmmount"/>
  16. </endpoint>
  17. </call>
  18. <log level="full">
  19. <property name="message" value="result"/>
  20. </log>
  21. </inSequence>
  22. <outSequence/>
  23. <faultSequence>
  24. </faultSequence>
  25. </resource>
  26. </api>
  27.  
  28. <?xml version="1.0" encoding="UTF-8"?>
  29. <api context="/updateAccountAmmount" name="updateAccountAmmount" xmlns="http://ws.apache.org/ns/synapse">
  30. <resource methods="POST">
  31. <inSequence>
  32. <log level="full">
  33. <property name="message" value="enter to the transfer of the money process"/>
  34. </log>
  35. <property expression="json-eval($.ammount)" name="ammount" scope="default" type="STRING"/>
  36. <property expression="json-eval($.accountId)" name="accountId" scope="default" type="STRING"/>
  37. <dbreport>
  38. <connection>
  39. <pool>
  40. <password>root</password>
  41. <driver>com.mysql.jdbc.Driver</driver>
  42. <url>jdbc:mysql://localhost:3306/trainingdb</url>
  43. <user>root</user>
  44. </pool>
  45. </connection>
  46. <statement>
  47. <sql><![CDATA[UPDATE accounts SET ammount = ? where accountId = ?]]></sql>
  48. <parameter expression="get-property('ammount')" type="CHAR"/>
  49. <parameter expression="get-property('accountId')" type="CHAR"/>
  50. </statement>
  51. </dbreport>
  52. <loopback/>
  53. </inSequence>
  54. <outSequence/>
  55. <faultSequence/>
  56. </resource>
  57. </api>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement