0
給定一個處理對ws服務調用的網關。我的目標是使用header-enricher
,因爲我會添加多種方法來gateway
,我想利用只有1 http:outbound-gateway
概括http:出站網關回復通道
我目前可以接收響應提高到Groovy腳本供應http:outbound-gateway's reply-channel
(2),但它沒有按似乎不想將結果返回到調用服務的實際方法
任何幫助,將不勝感激。謝謝!
<gateway id="registryService" service-interface="RegistryService">
<method name="create" request-channel="create-request-channel"
reply-channel="create-reply-channel" />
</gateway>
<chain input-channel="create-request-channel" output-channel="create-request-fulfillment-channel">
<transformer>
// groovy script that contains the method to be called in the ws (1)
</transformer>
<object-to-json-transformer/>
<header-enricher>
<reply-channel overwrite="true" ref="create-reply-fulfillment-channel" />
</header-enricher>
</chain>
<http:outbound-gateway request-channel="create-request-fulfillment-channel"
extract-request-payload="true"
expected-response-type="java.lang.String"
url="http://localhost:4567" http-method="POST" />
<chain input-channel="create-reply-fulfillment-channel"
output-channel="create-reply-channel">
<json-to-object-transformer type="JsonRpcResponse"/>
<transformer>
//groovy script to manipulate response (2)
</transformer>
</chain>