Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B2787200C70 for ; Thu, 4 May 2017 11:40:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B1213160B9F; Thu, 4 May 2017 09:40:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D87D3160BC4 for ; Thu, 4 May 2017 11:40:09 +0200 (CEST) Received: (qmail 29533 invoked by uid 500); 4 May 2017 09:40:09 -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 29493 invoked by uid 99); 4 May 2017 09:40:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 May 2017 09:40:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id EA53EC031B for ; Thu, 4 May 2017 09:40:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.502 X-Spam-Level: X-Spam-Status: No, score=-99.502 tagged_above=-999 required=6.31 tests=[KAM_NUMSUBJECT=0.5, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 6ro4DcVx02-Y for ; Thu, 4 May 2017 09:40:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 390325F405 for ; Thu, 4 May 2017 09:40:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7EA70E092E for ; Thu, 4 May 2017 09:40:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 41ECB21DED for ; Thu, 4 May 2017 09:40:04 +0000 (UTC) Date: Thu, 4 May 2017 09:40:04 +0000 (UTC) From: "Romain Manni-Bucau (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-7363) Support saaj-impl 1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 04 May 2017 09:40:10 -0000 Romain Manni-Bucau created CXF-7363: --------------------------------------- Summary: Support saaj-impl 1.4 Key: CXF-7363 URL: https://issues.apache.org/jira/browse/CXF-7363 Project: CXF Issue Type: Bug Reporter: Romain Manni-Bucau org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor (and actions like UsernameTokenAction) don't build the dom correctly and it fails with saaj(impl 1.4, here a way to build correctly the dom for the header appending: {code} new WSS4JOutInterceptor(outProps) { @Override protected void doSenderAction(final Document doc, final RequestData reqData, final List actions, final boolean isRequest) throws WSSecurityException { final String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); Element header = XMLUtils.getDirectChildElement(doc.getDocumentElement(), WSConstants.ELEM_HEADER, soapNamespace); final Element envelope = doc.getDocumentElement(); if (header == null) { header = createElementInSameNamespace(envelope.getOwnerDocument(), envelope, WSConstants.ELEM_HEADER); final Node firstChild = envelope.getFirstChild(); if (firstChild == null) { envelope.appendChild(header); } else { envelope.insertBefore(header, firstChild); } } Element securityHeader = WSSecurityUtil.getSecurityHeader(header, getString(WSHandlerConstants.ACTOR, reqData.getMsgContext()), WSConstants.URI_SOAP12_ENV.equals(soapNamespace)); if (securityHeader == null) { securityHeader = header.getOwnerDocument().createElementNS(WSConstants.WSSE_NS, "wsse:Security"); securityHeader.setAttributeNS(WSConstants.XMLNS_NS, "xmlns:wsse", WSConstants.WSSE_NS); final Node firstChild = header.getFirstChild(); if (firstChild == null) { header.appendChild(securityHeader); } else { header.insertBefore(securityHeader, firstChild); } } super.doSenderAction(doc, reqData, actions, isRequest); } private Element createElementInSameNamespace(final Document doc, final Element parent, final String localName) { String qName = localName; String prefix = parent.getPrefix(); if (prefix != null && prefix.length() > 0) { qName = prefix + ":" + localName; } String nsUri = parent.getNamespaceURI(); return doc.createElementNS(nsUri, qName); } } {code} Same kind of document fix should be done on the actions. -- This message was sent by Atlassian JIRA (v6.3.15#6346)