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 CC9819CCC for ; Fri, 30 Mar 2012 14:26:35 +0000 (UTC) Received: (qmail 64218 invoked by uid 500); 30 Mar 2012 14:26:35 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 64160 invoked by uid 500); 30 Mar 2012 14:26:35 -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 64153 invoked by uid 99); 30 Mar 2012 14:26:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 14:26:35 +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, 30 Mar 2012 14:26:32 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5E8D72388A2C; Fri, 30 Mar 2012 14:26:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1307441 - in /cxf/branches/2.5.x-fixes/rt/bindings/soap/src: main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Date: Fri, 30 Mar 2012 14:26:11 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120330142611.5E8D72388A2C@eris.apache.org> Author: dkulp Date: Fri Mar 30 14:26:10 2012 New Revision: 1307441 URL: http://svn.apache.org/viewvc?rev=1307441&view=rev Log: 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.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Modified: cxf/branches/2.5.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.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=1307441&r1=1307440&r2=1307441&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java (original) +++ cxf/branches/2.5.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java Fri Mar 30 14:26:10 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.5.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.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java?rev=1307441&r1=1307440&r2=1307441&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java (original) +++ cxf/branches/2.5.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptorTest.java Fri Mar 30 14:26:10 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");