ws へのサービス呼び出しを処理するゲートウェイが与えられます。私の目標は、複数のメソッドを追加し、1 つだけを利用したいので、 http:outbound-gateway's reply-channel
usingを提供することです。header-enricher
gateway
http:outbound-gateway
現在、groovy スクリプト (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>