cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <>
Subject [jira] [Commented] (CXF-4805) SOAP services try to process HTTP 'OPTIONS'
Date Mon, 04 Feb 2013 13:48:12 GMT


Freeman Fang commented on CXF-4805:

Hi Benson,

I think in some scenario cxf endpoint can handle request from local browser is useful, especially
for some demos, let customer open a local browser and edit a soap message and send it out
and see the response from same browser page is convenient.

For the CORS issue, I generally add a out interceptor for the cxf endpoint in demos, something
public class EnableCORSInterceptor extends AbstractPhaseInterceptor<Message> {

    public EnableCORSInterceptor() {

    public void handleMessage(Message message) throws Fault {
        Map<String, List<String>> headers = Headers.getSetProtocolHeaders(message);
        try {
            //Access-Control-Allow-Origin:* Access-Control-Allow-Methods:POST,GET
            headers.put("Access-Control-Allow-Origin", Arrays.asList("*"));
            headers.put("Access-Control-Allow-Methods", Arrays.asList("POST", "GET"));
        } catch (Exception ce) {
            throw new Fault(ce);
This can make browser send/receive soap message to/from CXF endpoint.

> SOAP services try to process HTTP 'OPTIONS'
> -------------------------------------------
>                 Key: CXF-4805
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.5.6
>            Reporter: Benson Margulies
> We tried, somewhat absentmindedly, to access a JAX-WS SOAP service cross-origin-ly from
a browser. The browser sent the required OPTIONS ahead of the POST, and CXF went ahead and
tried to handle it as if it was a SOAP request, and then got very sad trying to parse the
empty payload as XML.
> Shouldn't CXF have produced a clear log message and error response about not understanding

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message