Results 1 to 3 of 3

Thread: Need detail information on http outbound gateway

  1. #1
    Join Date
    Oct 2010
    Posts
    11

    Default Need detail information on http outbound gateway

    Hi,

    I am beginner to spring integration and working on a requirement where I need to send xml file via http POST to external website and need HttpReponse code back.

    For the same, I have found out that I need HttpOutboundGateway implementation. from other thread, I have got the complete attribute lists which can be used with gateway which is shown below. spring reference manual, did not describes every attribute details so I appreciate if some one guide me on it. many attributes are self explanatory but specifically, I am looking for how to use following attributes.

    1. request-factory="testRequestFactory" : how can I create and use custom request factory here. sample code will be appreciated.

    2. mapped-request-headers and mapped-response-headers : how to use these attributes?

    3. <http:uri-variable name="foo" expression="headers.bar"/> : what is this for?

    4. order="77" : what is this for?

    5. I understand that response will be back in "replies" channel. but how can I get HttpResponse object from this channel? I mean, how can I read Http status code?

    6. spring reference manual explains that we can use "request-mapper" attribute to specify custom OutboundRequestMapper so can some one explains by example, how to create custom OutboundRequestMapper?

    <http:outbound-gateway id="fullConfig"
    url="http://localhost/test2"
    http-method="PUT"
    request-channel="requestChannel"
    request-factory="testRequestFactory"
    request-timeout="1234"
    message-converters="converterList"
    extract-request-payload="false"
    expected-response-type="java.lang.String"
    mapped-request-headers="requestHeader1, requestHeader2"
    mapped-response-headers="responseHeader"
    reply-channel="replies"
    charset="UTF-8"
    order="77"
    auto-startup="false">
    <http:uri-variable name="foo" expression="headers.bar"/>
    </http:outbound-gateway>

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Have you looked at Spring Integration samples?
    There is a couple of samples that shows HttpOutboundGateway.
    Look at 'travel' sample and 'http-multipart' and let us know if you need more info.
    To get samples check out this blog: http://blog.springsource.com/2010/09...ation-samples/

  3. #3
    Join Date
    Oct 2010
    Posts
    11

    Default

    Thanks Oleg,

    and sorry for late reply. I tried and tested multipart sample and got fair idea about HttpOutboundGateway. but still documents has lack of information like how to build custom request mapper, details of each attributes associated with this gateway, how to tie custom executor etc. Apology in advance if it is there and I did not found out yet.

    Another query now I am facing is to get the HttpResponse back and to know status code. Can you tell me please how can I get Http status code once request is sent through http outbound gateway?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •