Topic
  • 10 replies
  • Latest Post - ‏2016-10-14T19:04:49Z by swlinn
cmari
cmari
4 Posts

Pinned topic HTTP Response code 400

‏2013-02-05T05:46:05Z |
We have a WSP service with a set of request, response and error rules. And we have set Process backend errors to OFF. Recently we upgraded the firmware version to 3.8.2.14 (from 3.8.2.0). Post that we found an issue in all error responses sent back (by error rule) to the clients, the protocol response code is set to 400. Because of this most of the SOAP clients are not able to parse the response message.

Some data collected from probe and client response.

Input context of error rule
var://service/error-code string 0x00d30003
var://service/error-headers string 'HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset="utf-8"
X-Backside-Transport: FAIL FAIL
Connection: close'

Output context of error rule
var://service/error-code string 0x00d30003
var://service/error-headers string 'HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset="utf-8"
X-Backside-Transport: FAIL FAIL
Connection: close'

Response header received in the client
Firmware: 3.8.2.14
HTTP/1.1 400 Error
Content-Type: text/xml
X-Backside-Transport: FAIL FAIL
Connection: close

Whereas in the previous firmware we are getting 500 response code, for the same configuration.
Response header received in firmware 3.8.2.0
HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
X-Backside-Transport: FAIL FAIL
Connection: close

Tested in the latest fixpack (3.8.2.17) also, getting 400 response only.

Any suggestions to solve this issue?
  • chauhan_vin1
    chauhan_vin1
    26 Posts

    Re: HTTP Response code 400

    ‏2013-07-23T23:28:35Z  

    Check for your request rule may be the Input Output variables are modified causing to do an empty payload POST which could cause the service to throw back HTTP 400 Bad Request.

    The value of dp:response-header('x-dp-response-code') in Error rule is always "HttpStatusCode Error" for example 400 Error , the same value in response rule is "HttpErrorCode Processed".

     

     

  • msmps
    msmps
    212 Posts

    Re: HTTP Response code 400

    ‏2013-07-24T13:21:36Z  

    Are you guys doing decryption?

    This might help.

    https://www.ibm.com/developerworks/community/forums/html/topic?id=bf1f4fad-8eb4-4fb2-9225-d62b8cf2de72#8be7584d-ce0b-4713-8c61-a92d6e01c483

    http://www-01.ibm.com/support/docview.wss?uid=swg21598653

  • cmari
    cmari
    4 Posts

    Re: HTTP Response code 400

    ‏2013-07-25T04:05:41Z  
    • msmps
    • ‏2013-07-24T13:21:36Z

    Thanks Robert, we are doing decryption in our flow. We got the same advise from IBM support team, the issue got resolved by disabling "Rewrite Error Messages". 

  • dannyd103
    dannyd103
    8 Posts

    Re: HTTP Response code 400

    ‏2016-05-06T13:59:09Z  

    Hi

     

    I have the same issue although not caused by a firmware upgrade.

    The difference is the version of SOAP used.

    SOAP 1.1 - HTTP Response code 500

    SOAP 1.2 - HTTP Response code 400

    The requests fail validation for the same reason and the same soap error message is sent back to the client, only different HTTP response codes in the error-header

    disabling "Rewrite Error Messages" had no effect.

     

    Any ideas what could be causing this?

  • HermannSW
    HermannSW
    6388 Posts

    Re: HTTP Response code 400

    ‏2016-05-06T15:37:38Z  
    • dannyd103
    • ‏2016-05-06T13:59:09Z

    Hi

     

    I have the same issue although not caused by a firmware upgrade.

    The difference is the version of SOAP used.

    SOAP 1.1 - HTTP Response code 500

    SOAP 1.2 - HTTP Response code 400

    The requests fail validation for the same reason and the same soap error message is sent back to the client, only different HTTP response codes in the error-header

    disabling "Rewrite Error Messages" had no effect.

     

    Any ideas what could be causing this?

    The SOAP 1.1 spec does:
    https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529

    "In case of a SOAP error while processing the request, the SOAP HTTP server MUST issue an HTTP 500 "Internal Server Error" response and include a SOAP message in the response containing a SOAP Fault element (see section 4.4) indicating the SOAP processing error."

     

    Hermann.

  • dannyd103
    dannyd103
    8 Posts

    Re: HTTP Response code 400

    ‏2016-05-09T08:15:48Z  
    • HermannSW
    • ‏2016-05-06T15:37:38Z

    The SOAP 1.1 spec does:
    https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529

    "In case of a SOAP error while processing the request, the SOAP HTTP server MUST issue an HTTP 500 "Internal Server Error" response and include a SOAP message in the response containing a SOAP Fault element (see section 4.4) indicating the SOAP processing error."

     

    Hermann.

    Hi Hermann,

    Is this the same for SOAP 1.2?

    I'm getting a 400 response from the Datapower when using SOAP 1.2.

     

  • HermannSW
    HermannSW
    6388 Posts

    Re: HTTP Response code 400

    ‏2016-05-09T08:49:22Z  
    • dannyd103
    • ‏2016-05-09T08:15:48Z

    Hi Hermann,

    Is this the same for SOAP 1.2?

    I'm getting a 400 response from the Datapower when using SOAP 1.2.

     

    Hi,

    no, it is not the same fpor SOAP 1.2 and the reason you see a different HTTP statius code returned.
    The difference is because of SOAP 1.1/SOAP 1.2 specs, and not because of DataPower.

    Hermann.

  • GeetPandey
    GeetPandey
    38 Posts

    Re: HTTP Response code 400

    ‏2016-10-13T16:01:45Z  

    Check for your request rule may be the Input Output variables are modified causing to do an empty payload POST which could cause the service to throw back HTTP 400 Bad Request.

    The value of dp:response-header('x-dp-response-code') in Error rule is always "HttpStatusCode Error" for example 400 Error , the same value in response rule is "HttpErrorCode Processed".

     

     

    Is there a way to override Status message other than Processed using <dp:set-http-response-header name="'x-dp-response-code'" value="'201 Created'"/>  

  • kenhygh
    kenhygh
    2164 Posts

    Re: HTTP Response code 400

    ‏2016-10-14T12:52:21Z  

    Is there a way to override Status message other than Processed using <dp:set-http-response-header name="'x-dp-response-code'" value="'201 Created'"/>  

    Not that I'm aware of, someone else may have another trick.

    Ken

  • swlinn
    swlinn
    1396 Posts

    Re: HTTP Response code 400

    ‏2016-10-14T19:04:49Z  
    • kenhygh
    • ‏2016-10-14T12:52:21Z

    Not that I'm aware of, someone else may have another trick.

    Ken

    GatewayScript can set the response headers as well

    var hm = require('header-metadata');

    hm.response.statusCode = '201 Created'; // if in request rule and skip-backside scenario
    hm.current.statusCode  = '201 Created'; // if in response rule

     

    Regards,

    Steve