4

RESTサービス呼び出しをPOSTして、返されるデータを取得する必要があります(これはすべてJSONを使用しています)。応答チャネルをチェーンとして持つアウトバウンドゲートウェイがあり、チェーンには1つのトランスフォーマーがあります。

<int-http:outbound-gateway
    url="#{appProperties['rootUrl']}#{appProperties['myMethod']}"
    request-channel="myRequestChannel" reply-channel="myResponseChannel" >
</int-http:outbound-gateway>

<int:channel id="myResponseChannel"/>

<int:chain input-channel="myResponseChannel">
    <int:transformer ref="genericResponseTransformer"/>
</int:chain>

ただし、トランスフォーマーを介してデバッグすると、返されるペイロードは単なるHttpStatusオブジェクトです。

多分私は何か間違ったことをしているのですか?どんな助けでも大歓迎です。ありがとう!

4

1 に答える 1

9

ゲートウェイで指定しない場合expected-response-type、デフォルトの動作では、応答メッセージにはステータスコードのみが含まれます(expected-response-typeはnullです)。設定してみてくださいexpected-response-type="java.lang.String"

<int-http:outbound-gateway
  url="#{appProperties['rootUrl']}"
  http-method="#{appProperties['myMethod']}"
  expected-response-type="java.lang.String"
  request-channel="myRequestChannel" reply-channel="myResponseChannel" />
于 2012-02-15T19:37:10.917 に答える