Topic
6 replies Latest Post - ‏2013-04-30T12:51:29Z by RolfRander
RolfRander
RolfRander
23 Posts
ACCEPTED ANSWER

Pinned topic Access HTTP response codes from rule

‏2013-04-29T05:19:44Z |

Hi,

I am communicating with a backend which returns HTTP 500, but my response rule fails in the signature verification step and returns "no signature found" to the client.

Is there a way of accessing the raw http response, or atleast the http response code, from an xslt-transform?

In the log I see "event code 0x80e0015b - the server has returned an HTTP response", but the message text says response code 500.

I would like to inform the client of the http response to ease debugging.

 

regards

rolf rander

  • VMNanduri
    VMNanduri
    11 Posts
    ACCEPTED ANSWER

    Re: Access HTTP response codes from rule<Can you try to set 'process backedn errors' to 'on' in proxy settings

    ‏2013-04-29T09:13:27Z  in response to RolfRander
    • VMNanduri
      VMNanduri
      11 Posts
      ACCEPTED ANSWER

      Re: Access HTTP response codes from rule<Can you try to set 'process backedn errors' to 'on' in proxy settings

      ‏2013-04-29T09:20:02Z  in response to VMNanduri

      Hi ,

      Sorry that I edited the subject line.

      Can you try to to set 'Process Backend Errors' to 'on'  so that DataPower will accept backedn HTTP errors and raise corresponding errors.

       

      Thanks,

      Lakshman.

    • RolfRander
      RolfRander
      23 Posts
      ACCEPTED ANSWER

      Re: Access HTTP response codes from rule<Can you try to set 'process backedn errors' to 'on' in proxy settings

      ‏2013-04-29T09:24:15Z  in response to VMNanduri

      I am not exactly sure what you mean.

      Under "advanced proxy settings" there is a setting for "Process HTTP Errors". It turns out that this actually means "should http-errors be processed as regular messages". When setting this to "off", I get "failed to establish a backside connection" (which might be the actual error here, I guess I need to create a specific test-case to look for http response codes).

      Thank you.

       

      regards, rolf rander

      • VMNanduri
        VMNanduri
        11 Posts
        ACCEPTED ANSWER

        Re: Access HTTP response codes from rule<Can you try to set 'process backedn errors' to 'on' in proxy settings

        ‏2013-04-29T09:30:55Z  in response to RolfRander

        Hi,

        I am sorry I was confused, It will raise an error when it is off. and what you said is true that you've to handle them using a xsl either in error rule or in response rule based on the proxy settings you have made.

        Thanks,

        Lakshman.

         

         

  • swlinn
    swlinn
    1344 Posts
    ACCEPTED ANSWER

    Re: Access HTTP response codes from rule

    ‏2013-04-29T18:31:15Z  in response to RolfRander

    You can have a transformation action in your response rule that looks at x-dp-response- code ...

            <xsl:variable name="respCode" select="normalize-space(dp:response-header('x-dp-response-code'))"/>
     

    Regards,

    Steve

    • RolfRander
      RolfRander
      23 Posts
      ACCEPTED ANSWER

      Re: Access HTTP response codes from rule

      ‏2013-04-30T12:51:29Z  in response to swlinn

      Thank you, exactly what I was looking for.

       

      regards, rolf rander

      Updated on 2013-04-30T12:51:52Z at 2013-04-30T12:51:52Z by RolfRander