Announcement Announcement Module
Collapse
No announcement yet.
How to authenticate and download a resouce from a website using http:inbound-channel Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to authenticate and download a resouce from a website using http:inbound-channel

    Hi everyone ,


    Can someone help me in this my requirement is below

    1)Authenticate to a website(Foe example www.test.com/login)
    2)Download the resource from the website after authenticating(http://www.test.com/login/Home/Docum..._ID=2131037941)

    A sample configuration/code will be really helpfull

  • #2
    If the web server uses cookies (e.g. jsessionid), there is a new feature on the http outbound gateway in 2.1 (Release Candidate 1 was released last week). Update your POMs to 2.1.0.RC1. GA will be out soon.

    If you set 'transfer-cookies="true"' on <int-http-outbound-gateway/> a set-cookie header on the first response becomes a cookie header in the reply message and is available on subsequent message sends to other gateways.

    A typical flow might be...

    ...->logonGateway->transformer(set up next request)->requestGateway->...

    Here's the doc from the reference manual...

    Cookies

    Basic cookie support is provided by the transfer-cookies attribute on the outbound gateway. When set to true (default is false), a Set-Cookie header received from the server in a response will be converted to Cookie in the reply message. This header will then be used on subsequent sends. This enables simple stateful interactions, such as...

    ...->logonGateway->...->doWorkGateway->...->logoffGateway->...

    If transfer-cookies is false, any Set-Cookie header received will remain as Set-Cookie in the reply message, and will be dropped on subsequent sends.

    Comment


    • #3
      Originally posted by Gary Russell View Post
      A typical flow might be...

      ...->logonGateway->transformer(set up next request)->requestGateway->...
      Is there a sample for such configuration? up-today it is the standard scenario for http communication. It seems to me to be very complicated configuration. probably not. A sample would be very helpful.

      Comment


      • #4
        I don't think there's a sample for this, but there is a test case; see the cookie tests here... https://github.com/SpringSource/spri.../http/outbound

        It's really not complicated.

        Comment

        Working...
        X