cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] Resolved: (CXF-999) SOAP 1.1 Fault returned with HTTP 200 status code
Date Sat, 03 Oct 2009 17:45:23 GMT


Daniel Kulp resolved CXF-999.

       Resolution: Fixed
    Fix Version/s: 2.1.6

A little while ago, we did discover on some non-buffered servlet engines, we WERE setting
the response code way too late.   This has been fixed.

> SOAP 1.1 Fault returned with HTTP 200 status code
> -------------------------------------------------
>                 Key: CXF-999
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 2.0.1
>         Environment: Windows XP, Orion Server 2.0.7
>            Reporter: Noel Trout
>             Fix For: 2.1.6
>         Attachments:
> We have enabled schema validation for JAXB bindings.  However, if unmarshalling fails
because of invalid XML, a SOAP fault is returned correctly but the HTTP response code is 200.
 I am expecting an HTTP response code of 500, as it is my understanding this is part of the
SOAP 1.1 specification.
> --  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. --
> It appears that the class Soap11FaultOutInterceptor is trying to set the response code
correctly with the following:
> message.put(org.apache.cxf.message.Message.RESPONSE_CODE, new Integer(500));
> However, this appears to be happening too late.  I have a suspicion that it is happening
too late in the interceptor chain.  I have a temporary fix in place.  I have registered a
custom fault out interceptor.  It uses the exact same code as in Soap11FaultOutInterceptor,
but my interceptor is running in phase Phase.SETUP on the outbound fault chain.  With my custom
interceptor registered, the HTTP response code is correctly set to 500.  See sample from services.xml
> <jaxws:endpoint id="PartnerSSOWebService" wsdlLocation="xml/wsdl/PartnerSSOWebService.wsdl"
>         <jaxws:implementor>
>             <ref bean="PartnerSSOWebServiceImpl" /> 
>         </jaxws:implementor>
>         <jaxws:inInterceptors>
>             <ref bean="DOMInflowInterceptor" />
>             <ref bean="WSSecurityInflowInterceptor" />
>         </jaxws:inInterceptors>   
>         <jaxws:outFaultInterceptors>
>             <ref bean="HttpErrorCodeFaultInterceptor" />
>         </jaxws:outFaultInterceptors>     
>         <jaxws:properties>
>             <entry key="schema-validation-enabled" value="true" />
>         </jaxws:properties>
>     </jaxws:endpoint>

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message