Topic
11 replies Latest Post - ‏2013-08-25T07:57:29Z by NILAY97
NILAY97
NILAY97
178 Posts
ACCEPTED ANSWER

Pinned topic Same Response has to be made Request

‏2013-04-30T11:11:20Z |
  • swlinn
    swlinn
    1344 Posts
    ACCEPTED ANSWER

    Re: Same Response has to be made Request

    ‏2013-04-30T15:01:00Z  in response to NILAY97

    Can you elaborate on your question?  I'm not sure what you are asking.

    Regards,

    Steve

    • Newbie_DP
      Newbie_DP
      22 Posts
      ACCEPTED ANSWER

      Re: Same Response has to be made Request

      ‏2013-05-01T05:57:42Z  in response to swlinn

      Hi Steve,

      Requirement is:-

      1. DP will receive a request from consumer.

      2. DP will pass that request you backend.

      3. Response from backend will be digitally signed and then base64 encoded n send it back to backend.

      Note:- the first response will not be shared with consumer.

      4. The response of digitally signed and base64 encoded request needs to be shared with consumer.

      Also we are able to route first response back to backend (without sending it to consumer) and now the second response from backend needs to be routed to consumer so how to do that ? Please suggest.

      Thank you

       

      • swlinn
        swlinn
        1344 Posts
        ACCEPTED ANSWER

        Re: Same Response has to be made Request

        ‏2013-05-01T13:20:23Z  in response to Newbie_DP

        Ok, so if I understand you, the response to the consumer request needs to be sent to another provider, and that response is returned to the consumer.  This can surely be done.  Your response rule will receive the backend response in the INPUT context.  You can use that context to create the request (eg, digitally signed, etc) and PIPE that request to a result action that has your 2nd provider as the destination url of the Results action.  If you specify OUTPUT as the context of that Result action, the consumer will get the response from the second provider.

        Hope this helps,

        Regards,

        Steve

        • Newbie_DP
          Newbie_DP
          22 Posts
          ACCEPTED ANSWER

          Re: Same Response has to be made Request

          ‏2013-05-02T17:23:22Z  in response to swlinn

          Hi Steve,

          I tried the steps you mentioned but i cannot route second response to consumer becos i do not have url to route the response.

          Requirement:-

          1. Consumer will send first request to Datapower (DP).

          2. Datapower will receive the first request and send first request to backend (Host).

          3. Backend will response and send the first response to DP.

          4. DP will receive the first response and will not forward it to the consumer instead DP will forward the first response back to the same backend after digitally signing the first response (this will be second request as per the backend).

          5. Backend will reply to the digitally signed request and send it to DP (second response from backend).

          6. Now from DP we have to route the second response to consumer. Please let us know how to do this.

          The issue I am facing is that i am not able to route the second response to consumer because i do not have any specific url of consumer.

          If you can let me know that how DP figure out to which consumer response needs to be sent then that would be of great help or anyother alternative method.

          Thank You

          • swlinn
            swlinn
            1344 Posts
            ACCEPTED ANSWER

            Re: Same Response has to be made Request

            ‏2013-05-02T17:49:17Z  in response to Newbie_DP

            I'm assuming you are receiving your request over a HTTP(S) connection.  All you have to do is place your final response in the OUTPUT context of your response rule, and DataPower will send the response to the front side connection it has maintained for the request.

            Regards,

            Steve

            • Newbie_DP
              Newbie_DP
              22 Posts
              ACCEPTED ANSWER

              Re: Same Response has to be made Request

              ‏2013-05-02T17:54:51Z  in response to swlinn

              Hi Steve,

              Yes its over https.

              Alright thank you. I'll check this tomorrow and will let you an update accordingly.

              But is there any way to check and manipulate how DP is routing the response and on what basis?

              Thanks You :)

              • swlinn
                swlinn
                1344 Posts
                ACCEPTED ANSWER

                Re: Same Response has to be made Request

                ‏2013-05-02T18:13:01Z  in response to Newbie_DP

                HTTP is a request / reply protocol.  You will have established a HTTP session when the request is sent, and a reply will be sent to the client over the open session by providing a response in the OUTPUT context.  There is no client based "routing" per se for HTTP.

                Regards,

                Steve

                • NILAY97
                  NILAY97
                  178 Posts
                  ACCEPTED ANSWER

                  Re: Same Response has to be made Request

                  ‏2013-05-04T14:18:11Z  in response to swlinn

                  Hi Steve,

                  Thanks for the information. Hey i got a new query.  From host i'am getting " Cookie information in the http response header ", the same cookie has to be inserted in the request by DataPower and fire it back to backend.

                   

                  Could you please tell me how to generate this cookie at DataPower, and insert the same cookie in the request.

                   

                  Thanks,

                  Nilay

                  • swlinn
                    swlinn
                    1344 Posts
                    ACCEPTED ANSWER

                    Re: Same Response has to be made Request

                    ‏2013-05-14T13:36:40Z  in response to NILAY97

                    Requests have a HTTP Header of Cookie which consists of name=value pairs with semi colon separation between various cookies in the header.  On responses, you send back to the browser a Set-Cookie HTTP header which also has name=value but also has additional information such as expiration, domain, path, etc.  This tells the browser if the name=value pair should then be sent on subsequent requests.

                    So I'm not exactly sure what you are saying your requirement is.  Is your client a browser? Are you getting a Cookie http header in your client request?  If so it will be passed on to the backend like any other HTTP header.  Are you being asked to add something to an existing Cookie, eg, a new name=value pair?  I'm not sure what you mean by Cookie information in the response header unless you are saying your backend is returning a Set-Cookie.  Perhaps you can show the flow of what your requirement is.

                    Regards,

                    Steve

  • E6MC_satyanand_ambati
    3 Posts
    ACCEPTED ANSWER

    Re: Same Response has to be made Request

    ‏2013-08-23T19:09:34Z  in response to NILAY97

    R u sucessfull in implementing this.? i also have the same requirement

    • NILAY97
      NILAY97
      178 Posts
      ACCEPTED ANSWER

      Re: Same Response has to be made Request

      ‏2013-08-25T07:57:29Z  in response to E6MC_satyanand_ambati

      Hi Satya,

       

      Yes we implemented this successfully. In our condition, DataPower had to sent back the response which has come from backend as request.

      We did a simple dp:url-open and saved the entire response in a context variable.

      Let me know if this is what you need.