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 6E4B310146 for ; Thu, 26 Mar 2015 11:39:27 +0000 (UTC) Received: (qmail 5690 invoked by uid 500); 26 Mar 2015 11:38:53 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 5654 invoked by uid 500); 26 Mar 2015 11:38:53 -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 5587 invoked by uid 99); 26 Mar 2015 11:38:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Mar 2015 11:38:53 +0000 Date: Thu, 26 Mar 2015 11:38:53 +0000 (UTC) From: "Alessio Soldano (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CXF-6319) Regression: failing namespace resolution after CXF-5891 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-6319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381751#comment-14381751 ] Alessio Soldano edited comment on CXF-6319 at 3/26/15 11:38 AM: ---------------------------------------------------------------- I've had a preliminary look at the issue here. The problem seems to come from the fact that the the namespace 'xs' in the message above is declared in the body element and the SOAPBody of the message is built in SAAJInterceptor from a stax stream that points to the first element after the body. The elements before and up to the body are consumed from the stream when looking for soap headers in the ReadHeadersInterceptor, which is where the CXF-5891 optimization took place. Now, if there's no soap header and hence CXF-5891 causes no DOM content to be created during headers scan, namespace declarations in body and envelope elements (e.g. the only possible parents of body content elements) are lost. The SAAJInterceptor has a hack for copying the contents of the DOM created by ReadHeadersInterceptor into the SOAPPart that will contain the SOAPBody to be created later; this of course is of no use if no DOM was created in ReadHeadersInterceptor as no soap headers were detected. I'll likely fix this by explicitly keeping track of the namespace declarations found in envelope and body elements and applying them on the SOAPPart in SAAJInInterceptor. was (Author: asoldano): I've had a preliminary look at the issue here. The problem seems to come from the fact that the the namespace 'xs' in the message above is declared in the body element and the SOAPBody of the message is built in SAAJInterceptor from a stax stream that points to the first element after the body. The elements before and up to the body are consumed from the stream when looking for soap headers in the ReadHeadersInterceptor, which is where the CXF-5891 optimization took place. Now, if there's no soap header and hence CXF-5891 causes no DOM content to be created during headers scan, namespace declarations in body and envelope elements (e.g. the only possible parents of body content elements) are lost. The SAAJInterceptor has a hack for copying the contents of the DOM created by ReadHeadersInterceptor into the SOAPPart that will contain the SOAPBody to be created later; this of course is of no use if no DOM was created in ReadHeadersInterceptor as no soap headers were detected. I'll likely fix this by explicitly storing namespace declarations in envelope and body elements and applying them on the SOAPPart in SAAJInInterceptor. > Regression: failing namespace resolution after CXF-5891 > ------------------------------------------------------- > > Key: CXF-6319 > URL: https://issues.apache.org/jira/browse/CXF-6319 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.7.14, 2.7.15 > Reporter: mustafa > > When using CXF 2.7.14 or later this request fails > {code:xml} > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > > hello > > > > {code} > with the error > {code:xml} > > > > > soap:Server > prefix xs is not bound to a namespace > > > > {code} > Prior to the changes for CXF-5891 this worked without any problems. Analysis from Red Hat engineering seems to say that it looks that all attributes and namespace settings in soap:envelop or soap:body elements are all ignored in ReadHeaderInterceptor and SAAJInInterceptor. -- This message was sent by Atlassian JIRA (v6.3.4#6332)