Axis2
  1. Axis2
  2. AXIS2-5281

HTTP 2xx responses other than 200 and 202 are treated as errors

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.7.0
    • Component/s: transports
    • Labels:

      Description

      According to SOAP specs v1.1 Section 6.2(http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529) and v1.2 Part 2 Section 7.5.1.2(http://www.w3.org/TR/2007/REC-soap12-part2-20070427/#http-reqbindwaitstate), all 2xx HTTP status codes are successful responses.

      In the case of SOAP v1.2, the spec even goes so far as to state "The SOAP HTTP binding follows the rules of any HTTP application which means that an implementation of the SOAP HTTP binding must understand the class of any status code, as indicated by the first digit, and treat any unrecognized response as being equivalent to the x00 status code of that class, with the exception that an unrecognized response must not be cached."

      Given that, an HTTP status code of 201 (Created) in response to a SOAP request currently throws an error. The 201 is just an example, as any 2xx status code other than 200 and 202 will also throw an error. The problem is in org.apache.axis2.transport.http.HTTPSender.handleResponse(MessageContext, HttpMethodBase) where all status codes that are not explicitly handled are treated as an error. After reading the spec, it looks like those unhandled 2xx status codes should be handled the same as 200. Therefore, I am attaching a patch that treats all 2xx status codes other than 202 as a 200 response.

      Revised handling should probably be considered for other status code classes/families as well. However, since those are error conditions anyway, they will probably have a much lesser impact.

        Activity

        Hide
        Hudson added a comment -

        Integrated in Axis2 #1338 (See https://builds.apache.org/job/Axis2/1338/)

        • Applied patch for AXIS2-5281 with few changes.
        • Added few test cases for AXIS2-5281. (Revision 1324778)

        Result = SUCCESS
        sagara :
        Files :

        • /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java
        • /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/HTTPSenderTest.java
        • /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/mock/server/BasicHttpServer.java
        • /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/mock/server/BasicHttpServerImpl.java
        Show
        Hudson added a comment - Integrated in Axis2 #1338 (See https://builds.apache.org/job/Axis2/1338/ ) Applied patch for AXIS2-5281 with few changes. Added few test cases for AXIS2-5281 . (Revision 1324778) Result = SUCCESS sagara : Files : /axis/axis2/java/core/trunk/modules/transport/http/src/org/apache/axis2/transport/http/HTTPSender.java /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/HTTPSenderTest.java /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/mock/server/BasicHttpServer.java /axis/axis2/java/core/trunk/modules/transport/http/test/org/apache/axis2/transport/http/mock/server/BasicHttpServerImpl.java
        Hide
        Sagara Gunathunga added a comment -

        Patch applied in r1324778.

        Show
        Sagara Gunathunga added a comment - Patch applied in r1324778.

          People

          • Assignee:
            Unassigned
            Reporter:
            Gregory Moyer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development