forked from membrane/api-gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxies.xml
More file actions
29 lines (25 loc) · 1.44 KB
/
proxies.xml
File metadata and controls
29 lines (25 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<spring:beans xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://membrane-soa.org/proxies/1/" xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://membrane-soa.org/proxies/1/ http://membrane-soa.org/schemas/proxies-1.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd">
<router>
<api port="2000">
<request>
<call url="https://api.predic8.de/shop/v2/products/14"/>
<!-- Extracts name and price from the JSON response and add 1 to the price -->
<setProperty name="name" value="${$.name}" language="jsonpath"/>
<setProperty name="price" value="${jsonPath('$.price')+1}"/>
<!-- Creates a new JSON body with the name and modified price -->
<template contentType="application/json">
{
"name": ${property.name + ' Big Pack'},
"price": ${property.price}
}
</template>
<call method="POST" url="https://api.predic8.de/shop/v2/products"/>
</request>
<return />
</api>
</router>
</spring:beans>