Announcement Announcement Module
Collapse
No announcement yet.
Not Getting Response Data With HTTP Outbound Gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not Getting Response Data With HTTP Outbound Gateway

    I need to POST a REST service call and get the data it returns (all of this is with JSON). I have an outbound-gateway with its reply-channel as a chain, and the chain has one transformer.

    HTML Code:
    <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>
    However when I debug through the transformer, the payload I get back is just an HttpStatus object.

    Maybe I'm doing something wrong? Any help would be greatly appreciated. Thanks!

  • #2
    Please see the reference manual (http://static.springsource.org/sprin...http-namespace); if you don't provide an 'expected-response-type' you just get the HttpStatus; if your reply is json, set...

    Code:
    expected-response-type="java.lang.String"
    ...on the outbound gateway.

    Comment

    Working...
    X