Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 461D09CCD for ; Fri, 6 Apr 2012 16:36:01 +0000 (UTC) Received: (qmail 30636 invoked by uid 500); 6 Apr 2012 16:36:01 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 30592 invoked by uid 500); 6 Apr 2012 16:36:01 -0000 Mailing-List: contact commits-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 commits@cxf.apache.org Received: (qmail 30584 invoked by uid 99); 6 Apr 2012 16:36:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 16:36:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 16:35:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8F7922388C02; Fri, 6 Apr 2012 16:35:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1310458 - in /cxf/branches/2.4.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Date: Fri, 06 Apr 2012 16:35:39 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120406163539.8F7922388C02@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri Apr 6 16:35:38 2012 New Revision: 1310458 URL: http://svn.apache.org/viewvc?rev=1310458&view=rev Log: Merged revisions 1307441 via svn merge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ........ r1307441 | dkulp | 2012-03-30 10:26:10 -0400 (Fri, 30 Mar 2012) | 9 lines Merged revisions 1307403 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1307403 | dkulp | 2012-03-30 09:27:33 -0400 (Fri, 30 Mar 2012) | 2 lines [CXF-4181] Fix for SAAJ + SOAP 1.2 fault... ........ ........ Modified: cxf/branches/2.4.x-fixes/ (props changed) cxf/branches/2.4.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java cxf/branches/2.4.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Propchange: cxf/branches/2.4.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.4.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=1310458&r1=1310457&r2=1310458&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java (original) +++ cxf/branches/2.4.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java Fri Apr 6 16:35:38 2012 @@ -226,12 +226,11 @@ public class SAAJInInterceptor extends A if (hasFault(message, xmlReader)) { - SOAPFault soapFault = - soapMessage.getSOAPPart().getEnvelope().getBody().addFault(); SoapFault fault = message.getVersion() instanceof Soap11 ? Soap11FaultInInterceptor.unmarshalFault(message, xmlReader) : Soap12FaultInInterceptor.unmarshalFault(message, xmlReader); +<<<<<<< HEAD if (fault.getFaultCode() != null) { soapFault.setFaultCode(fault.getFaultCode()); } @@ -243,21 +242,40 @@ public class SAAJInInterceptor extends A } if (fault.getDetail() != null && fault.getDetail().getFirstChild() != null) { +======= +>>>>>>> 941b6cf... [CXF-4181] Fix for SAAJ + SOAP 1.2 fault... - Detail detail = null; - Node child = fault.getDetail().getFirstChild(); - while (child != null) { - if (Node.ELEMENT_NODE == child.getNodeType()) { - if (detail == null) { - detail = soapFault.addDetail(); + SOAPFault soapFault = + soapMessage.getSOAPPart().getEnvelope().getBody().getFault(); + if (soapFault == null) { + soapFault = + soapMessage.getSOAPPart().getEnvelope().getBody().addFault(); + if (fault.getFaultCode() != null) { + SAAJUtils.setFaultCode(soapFault, fault.getFaultCode()); + } + if (fault.getMessage() != null) { + soapFault.setFaultString(fault.getMessage()); + } + if (fault.getRole() != null) { + soapFault.setFaultActor(fault.getRole()); + } + if (fault.getDetail() != null + && fault.getDetail().getFirstChild() != null) { + + Detail detail = null; + Node child = fault.getDetail().getFirstChild(); + if (child != null) { + detail = soapFault.addDetail(); + } + while (child != null) { + if (Node.ELEMENT_NODE == child.getNodeType()) { + Node importedChild = soapMessage.getSOAPPart().importNode(child, true); + detail.appendChild(importedChild); } - Node importedChild = soapMessage.getSOAPPart().importNode(child, true); - detail.appendChild(importedChild); + child = child.getNextSibling(); } - child = child.getNextSibling(); } } - DOMSource bodySource = new DOMSource(soapFault); xmlReader = StaxUtils.createXMLStreamReader(bodySource); } else { Modified: cxf/branches/2.4.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java?rev=1310458&r1=1310457&r2=1310458&view=diff ============================================================================== --- cxf/branches/2.4.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java (original) +++ cxf/branches/2.4.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Fri Apr 6 16:35:38 2012 @@ -45,7 +45,6 @@ import org.apache.cxf.binding.soap.inter import org.apache.cxf.headers.Header; import org.apache.cxf.interceptor.StaxInInterceptor; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; @@ -141,7 +140,6 @@ public class SAAJInInterceptorTest exten } @Test - @Ignore public void testFaultDetailSOAP12() throws Exception { try { prepareSoapMessage("../test-soap-12-fault-detail.xml");