Results 1 to 5 of 5

Thread: Add cookie to http outbound-gateway request

  1. #1
    Join Date
    Jan 2011
    Posts
    3

    Default Add cookie to http outbound-gateway request

    Using spring-integration 1.0.4. We have a service-to-service interaction where the SI is posting data to another web service. This post request must include a cookie value.

    Searching the forum, I did not find a similiar setup and problem. The http namespace does not document anything obvious on how to accomplish this either? Is the solution custom code in an OutboundRequestMapper or perhaps replace the <http:outbound-gateway> with a service activator and use httpclient directly?

    Any advice would be appreciated. Thanks.

  2. #2
    Join Date
    Jan 2011
    Posts
    3

    Default

    It appears that the outbound gateway does not support setting cookies (or additional http headers). I looked at src for SimpleHttpRequestExecutor.java and CommonsHttpRequestExecutor.java and neither provide a mechanism to do something like c.addRequestHeader().

    I was thinking that maybe if the channel message had headers of a certain namespace, that it might automatically apply them to the http connection, thereby setting the http request headers. Does this idea make sense for a future release?

    To solve my immediate need, I am going to scratch the outbound-gateway and write a quick and dirty service-activator to do the job.

  3. #3
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    Do you know when/if you'll be able to upgrade to Spring Integration 2.0?

  4. #4
    Join Date
    Jan 2011
    Posts
    3

    Default

    We are fairly invested in Spring 2.5.6, so moving to SI 2.0 (requiring Spring 3.x) maybe be 6 months out. No worries though... question answered.

  5. #5
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    Okay. It might be worth looking at the Spring 3.0 RestTemplate and underlying HTTP client-side library at least to get a few ideas.

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
  •