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 209A6EF04 for ; Tue, 19 Feb 2013 20:52:13 +0000 (UTC) Received: (qmail 62801 invoked by uid 500); 19 Feb 2013 20:52:13 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 62751 invoked by uid 500); 19 Feb 2013 20:52:13 -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 62744 invoked by uid 99); 19 Feb 2013 20:52:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 20:52:13 +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; Tue, 19 Feb 2013 20:52:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F201323889D5; Tue, 19 Feb 2013 20:51:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1447913 - /cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java Date: Tue, 19 Feb 2013 20:51:52 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130219205152.F201323889D5@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Feb 19 20:51:52 2013 New Revision: 1447913 URL: http://svn.apache.org/r1447913 Log: Merged revisions 1447900 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes ........ r1447900 | dkulp | 2013-02-19 15:27:14 -0500 (Tue, 19 Feb 2013) | 10 lines Merged revisions 1447874 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1447874 | dkulp | 2013-02-19 14:16:44 -0500 (Tue, 19 Feb 2013) | 2 lines Fix a problem where the wrong fault was returned. ........ ........ Modified: cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java Modified: cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?rev=1447913&r1=1447912&r2=1447913&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java (original) +++ cxf/branches/2.6.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java Tue Feb 19 20:51:52 2013 @@ -95,6 +95,18 @@ public class MustUnderstandInterceptor e checkUltimateReceiverHeaders(ultimateReceiverHeaders, mustUnderstandQNames, soapMessage); } } + @Override + public void handleFault(SoapMessage msg) { + Set unknowns = CastUtils.cast((Set)msg.get(MustUnderstandInterceptor.UNKNOWNS)); + if (msg.getExchange().getBindingOperationInfo() == null + && unknowns != null && !unknowns.isEmpty()) { + //per jaxws spec, if there are must understands that we didn't understand, but couldn't map + //to an operation either, we need to throw the mustunderstand fault, not the one related to + //an unknown operation + msg.setContent(Exception.class, new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), + msg.getVersion().getMustUnderstand())); + } + } private void checkUltimateReceiverHeaders(Set
ultimateReceiverHeaders, Set mustUnderstandQNames, @@ -236,6 +248,7 @@ public class MustUnderstandInterceptor e if (!notFound.isEmpty()) { + soapMessage.remove(UNKNOWNS); throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, notFound), soapVersion.getMustUnderstand()); } @@ -263,11 +276,10 @@ public class MustUnderstandInterceptor e Set paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(message); unknowns.removeAll(paramHeaders); + message.remove(MustUnderstandInterceptor.UNKNOWNS); if (!unknowns.isEmpty()) { throw new SoapFault(new Message("MUST_UNDERSTAND", BUNDLE, unknowns), message.getVersion().getMustUnderstand()); - } else { - message.remove(MustUnderstandInterceptor.UNKNOWNS); } } }