Topic
  • 7 replies
  • Latest Post - ‏2013-04-06T15:24:37Z by HermannSW
Arnab_Ghosh
Arnab_Ghosh
94 Posts

Pinned topic HTTP Response header

‏2013-04-04T18:01:30Z |
Hi,
I am setting many response headers like this below and i need to check in the probe whether the values are properly getting set or not. But in the probe I am only getting those values which are set as request header. Is there any way to check the same for response header?

<dp:set-http-response-header name="'Session-Id'" value="$response/response/sessionId"/>

Thanks,
Arnab
Updated on 2013-04-06T15:24:37Z at 2013-04-06T15:24:37Z by HermannSW
  • swlinn
    swlinn
    1395 Posts

    Re: HTTP Response header

    ‏2013-04-05T14:23:28Z  
    The response headers only show in the probe in the response rule. Where are you setting these response headers in the processing policy? If you set them in the request rule they should be visible in the response rule, although I don't know what would happen if the backend had the same header in its response. If that is a problem, you could always place your data into context and set the response header in the response rule xslt.

    Regards,
    Steve
  • Arnab_Ghosh
    Arnab_Ghosh
    94 Posts

    Re: HTTP Response header

    ‏2013-04-05T16:23:37Z  
    • swlinn
    • ‏2013-04-05T14:23:28Z
    The response headers only show in the probe in the response rule. Where are you setting these response headers in the processing policy? If you set them in the request rule they should be visible in the response rule, although I don't know what would happen if the backend had the same header in its response. If that is a problem, you could always place your data into context and set the response header in the response rule xslt.

    Regards,
    Steve
    Hi Steve,
    Its in the error rule where i need to add , update and remove headers. I tried with these 3 below but 1 and 2 are not working. What should i need to do? 'Connection' and 'Content-Type' are already there in the headers but they are neither removed nor updated.

    1. <dp:remove-http-response-header name="'Connection'"/>
    2. <dp:set-response-header name="'Content-Type'" value="'text/xml;charset=ISO-8859-1'"/>
    3. <dp:set-response-header name="'Date'" value="date:date-time()"/>
  • swlinn
    swlinn
    1395 Posts

    Re: HTTP Response header

    ‏2013-04-05T21:00:32Z  
    Hi Steve,
    Its in the error rule where i need to add , update and remove headers. I tried with these 3 below but 1 and 2 are not working. What should i need to do? 'Connection' and 'Content-Type' are already there in the headers but they are neither removed nor updated.

    1. <dp:remove-http-response-header name="'Connection'"/>
    2. <dp:set-response-header name="'Content-Type'" value="'text/xml;charset=ISO-8859-1'"/>
    3. <dp:set-response-header name="'Date'" value="date:date-time()"/>
    Hi Arnab,
    Modifying Content-Type has always been tricky in my opinion. By chance are you running your stylesheet after having a transformation output to the OUTPUT context? From my notes, you should try a transformation that does the header manipulation of Content-Type that has NULL input/output contexts, then any transformation that may write to the OUTPUT context. I can't necessarily speak to removing the Connection header, but it may have a similar issue. What does your error rule look like today?

    Regards,
    Steve
  • Arnab_Ghosh
    Arnab_Ghosh
    94 Posts

    Re: HTTP Response header

    ‏2013-04-05T21:21:00Z  
    • swlinn
    • ‏2013-04-05T21:00:32Z
    Hi Arnab,
    Modifying Content-Type has always been tricky in my opinion. By chance are you running your stylesheet after having a transformation output to the OUTPUT context? From my notes, you should try a transformation that does the header manipulation of Content-Type that has NULL input/output contexts, then any transformation that may write to the OUTPUT context. I can't necessarily speak to removing the Connection header, but it may have a similar issue. What does your error rule look like today?

    Regards,
    Steve
    Steve, in my error rule, I have 3 transform actions and then the result action. I am creating the response in the 2nd transform action, which has input as INPUT and output as ERROR_RESPONSE. I am returning this error response in the output using the result action. In the second response itself i am updating and deleting the headers. Addition of header "Date" worked fine but update and removal dint worked.
  • swlinn
    swlinn
    1395 Posts

    Re: HTTP Response header

    ‏2013-04-05T22:44:48Z  
    Steve, in my error rule, I have 3 transform actions and then the result action. I am creating the response in the 2nd transform action, which has input as INPUT and output as ERROR_RESPONSE. I am returning this error response in the output using the result action. In the second response itself i am updating and deleting the headers. Addition of header "Date" worked fine but update and removal dint worked.
    Hi Arnab,
    I've reviewed some internal forum threads on Content-Type manipulation, so I'd recommend you try the following to see if this helps.

    1) Move the http header manipulation to a stylesheet of it's own, input context=NULL, output context=NULL
    I also saw references to some trying to also do a dp:freeze-headers extension function
    2) Have your stylesheet that creates your error response follow that transformation action. Have it output to the OUTPUT context.
    3) Don't do your result action as you had the transformation action output to OUTPUT

    If this doesn't work, I'm out of suggestions, perhaps you should then open a PMR.

    Regards,
    Steve
  • Arnab_Ghosh
    Arnab_Ghosh
    94 Posts

    Re: HTTP Response header

    ‏2013-04-05T22:59:26Z  
    • swlinn
    • ‏2013-04-05T22:44:48Z
    Hi Arnab,
    I've reviewed some internal forum threads on Content-Type manipulation, so I'd recommend you try the following to see if this helps.

    1) Move the http header manipulation to a stylesheet of it's own, input context=NULL, output context=NULL
    I also saw references to some trying to also do a dp:freeze-headers extension function
    2) Have your stylesheet that creates your error response follow that transformation action. Have it output to the OUTPUT context.
    3) Don't do your result action as you had the transformation action output to OUTPUT

    If this doesn't work, I'm out of suggestions, perhaps you should then open a PMR.

    Regards,
    Steve
    Thanks Steve for your response. It is now updating the headers though not deleting the same.
    I have done exactly the same as you told only with one difference and that is my "SetHeader" transform action is following the "CreateResponse" transform action.
  • HermannSW
    HermannSW
    6065 Posts

    Re: HTTP Response header

    ‏2013-04-06T15:24:37Z  
    Thanks Steve for your response. It is now updating the headers though not deleting the same.
    I have done exactly the same as you told only with one difference and that is my "SetHeader" transform action is following the "CreateResponse" transform action.
    Hi Arnab,

    you did not state what you changed or what your config currently looks like.
    Please give more details.

     
    Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>