2012-02-15 12 views
4

RESTサービスコールをPOSTし、返すデータを取得する必要があります(これはすべてJSONで行います)。私は、その返信チャネルをチェーンとして持つアウトバウンド・ゲートウェイを持っていて、そのチェーンは1つのトランスを持っています。春の統合HTTPアウトバウンドゲートウェイレスポンスを取得

<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オブジェクトです。

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

答えて

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" /> 
+0

感謝のように働いてください! –

関連する問題