我需要将JSON内容设置为apache camel rest请求的消息有效负载。我尝试了如下。但它不起作用。
<rest path="/service" consumes="application/json" produces="application/json">
<put type="com.xxxx.yyyyy.esb.models.UserServiceMapping"
uri="/create">
<route>
<log message="${body.serviceUrl}" />
<log message="${body.mappedServiceObject}" />
<log message="${body.systemUserDetails.userName}" />
<log message="${body.systemUserDetails.password}" />
<setBody> <simple>{"${body.mappedServiceObject}":{"userName" :
"${body.userName}", "password" : "${body.password}"}} </simple> </setBody>
<setHeader headerName="CamelRestletLogin">
<simple>admin</simple>
</setHeader>
<setHeader headerName="CamelRestletPassword">
<simple>admin</simple>
</setHeader>
<to
uri="restlet:http://xxx.xxx.x.xx:8081/xxxxxx/services/yyyyyyy/V1.0/users/create?restletMethod=POST" />
</route>
</put>
</rest>