Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 3459 invoked from network); 18 Aug 2007 14:48:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Aug 2007 14:48:53 -0000 Received: (qmail 98040 invoked by uid 500); 18 Aug 2007 14:48:50 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 98028 invoked by uid 500); 18 Aug 2007 14:48:50 -0000 Mailing-List: contact cxf-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-issues@incubator.apache.org Received: (qmail 98012 invoked by uid 99); 18 Aug 2007 14:48:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2007 07:48:50 -0700 X-ASF-Spam-Status: No, hits=-98.8 required=10.0 tests=ALL_TRUSTED,DNS_FROM_DOB,RCVD_IN_DOB X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Aug 2007 14:48:52 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id ED71D7141FE for ; Sat, 18 Aug 2007 07:48:31 -0700 (PDT) Message-ID: <4195825.1187448511968.JavaMail.jira@brutus> Date: Sat, 18 Aug 2007 07:48:31 -0700 (PDT) From: "Matthias Germann (JIRA)" To: cxf-issues@incubator.apache.org Subject: [jira] Resolved: (CXF-827) SOAP Header element is returned to the client even if detached in a JAXWS Handler In-Reply-To: <9534156.1185272431211.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Matthias Germann resolved CXF-827. ---------------------------------- Resolution: Fixed Fix Version/s: 2.0.1 I can confirm that this issue is fixed in CXF 2.0.1 > SOAP Header element is returned to the client even if detached in a JAXWS Handler > --------------------------------------------------------------------------------- > > Key: CXF-827 > URL: https://issues.apache.org/jira/browse/CXF-827 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.0 > Reporter: Matthias Germann > Assignee: Jervis Liu > Fix For: 2.0.1 > > > If a JAXWS Handler detaches a SOAP Header element with the the detachNode() Method of the SOAPElement Class during inbound processing of a SOAP Message, the Header is still returned to the client in the SOAP Response. > Here is a code sample from my JAXWS Handler which detaches the Header element: > public boolean handleMessage(SOAPMessageContext msgCtx) { > if (isOutboundMessage(msgCtx)) { > return true; > } > try { > SOAPHeader header = msgCtx.getMessage().getSOAPPart().getEnvelope().getHeader(); > if (header == null) { > return true; > } > > List toRemove = new ArrayList(); > for (Iterator iter = header.getChildElements(); iter.hasNext();) { > Object obj = iter.next(); > if (obj instanceof SOAPElement) { > SOAPElement element = (SOAPElement) obj; > > // Security Headers suchen > Name name = element.getElementName(); > if (NsConstants.WSS.equals(name.getURI()) > && HandlerConstants.WSS_SECURITY_ELEM.equals(name.getLocalName())) { > log.debug("WSS Security Header found"); > toRemove.add(element); > } > } > } > > // Security Headers, welche erfoglreich bearbeitet wurden, entfernen > for (SOAPElement elem : toRemove) { > elem.detachNode(); > } > return true; > } catch(SOAPException e) { > log.error("Can't remove security header", e); > throw new RuntimeException("Can't remove security header", e); > } > > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.