Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <payloadFactory media-type="json">
- <format>{
- "accountId":$1,
- "ammount":$ctx:finalAmount
- }</format>
- <args>
- <arg evaluator="json" expression="$.accountTo"/>
- </args>
- </payloadFactory>
- <log level="full">
- <property name="message" value="start calling api full logs"/>
- </log>
- <call>
- <endpoint>
- <http format="rest" method="POST" uri-template="http://10.5.222.192:8282/updateAccountAmmount"/>
- </endpoint>
- </call>
- <log level="full">
- <property name="message" value="result"/>
- </log>
- </inSequence>
- <outSequence/>
- <faultSequence>
- </faultSequence>
- </resource>
- </api>
- <?xml version="1.0" encoding="UTF-8"?>
- <api context="/updateAccountAmmount" name="updateAccountAmmount" xmlns="http://ws.apache.org/ns/synapse">
- <resource methods="POST">
- <inSequence>
- <log level="full">
- <property name="message" value="enter to the transfer of the money process"/>
- </log>
- <property expression="json-eval($.ammount)" name="ammount" scope="default" type="STRING"/>
- <property expression="json-eval($.accountId)" name="accountId" scope="default" type="STRING"/>
- <dbreport>
- <connection>
- <pool>
- <password>root</password>
- <driver>com.mysql.jdbc.Driver</driver>
- <url>jdbc:mysql://localhost:3306/trainingdb</url>
- <user>root</user>
- </pool>
- </connection>
- <statement>
- <sql><![CDATA[UPDATE accounts SET ammount = ? where accountId = ?]]></sql>
- <parameter expression="get-property('ammount')" type="CHAR"/>
- <parameter expression="get-property('accountId')" type="CHAR"/>
- </statement>
- </dbreport>
- <loopback/>
- </inSequence>
- <outSequence/>
- <faultSequence/>
- </resource>
- </api>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement