Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0EE49EDDB for ; Mon, 4 Feb 2013 13:48:18 +0000 (UTC) Received: (qmail 71155 invoked by uid 500); 4 Feb 2013 13:48:15 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 69845 invoked by uid 500); 4 Feb 2013 13:48:13 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 69802 invoked by uid 99); 4 Feb 2013 13:48:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Feb 2013 13:48:12 +0000 Date: Mon, 4 Feb 2013 13:48:12 +0000 (UTC) From: "Freeman Fang (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-4805) SOAP services try to process HTTP 'OPTIONS' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13570162#comment-13570162 ] 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 like {code} public class EnableCORSInterceptor extends AbstractPhaseInterceptor { public EnableCORSInterceptor() { super(Phase.PRE_PROTOCOL); } @Override public void handleMessage(Message message) throws Fault { Map> 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); } } } {code} This can make browser send/receive soap message to/from CXF endpoint. Freeman > SOAP services try to process HTTP 'OPTIONS' > ------------------------------------------- > > Key: CXF-4805 > URL: https://issues.apache.org/jira/browse/CXF-4805 > 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 OPTIONS? -- 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: http://www.atlassian.com/software/jira