Index: modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FaultUtils.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FaultUtils.java (revision ) +++ modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/FaultUtils.java (revision ) @@ -0,0 +1,64 @@ +/* + * JBoss, Home of Professional Open Source. + * Copyright 2015, Red Hat Middleware LLC, and individual contributors + * as indicated by the @author tags. See the copyright.txt file in the + * distribution for a full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.wsf.stack.cxf.client.configuration; + +import org.apache.cxf.Bus; +import org.apache.cxf.feature.Feature; +import org.apache.cxf.interceptor.InterceptorProvider; +import org.apache.cxf.logging.FaultListener; +import org.jboss.wsf.stack.cxf.client.Constants; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +/** + * Utils methods for setting CXF features + * + * @author wuhuaxu@renwey.com + * @since 28-Feb-2017 + * + */ +public class FaultUtils +{ + public static void setFaultListener(Bus bus, Map properties) { + final String faultListenerClassName = properties.get(FaultListener.class.getName()); + if (faultListenerClassName != null) { + MapToBeanConverter converter = new MapToBeanConverter(properties); + FaultListener faultListenerInstance = newInstance(faultListenerClassName, converter); + bus.getProperties().put(FaultListener.class.getName(), faultListenerInstance); + } + } + + private static FaultListener newInstance(String className, MapToBeanConverter converter) + { + try + { + return (FaultListener)(className.startsWith(MapToBeanConverter.BEAN_ID_PREFIX) ? converter.get(className) : converter.newInstance(className)); + } + catch (Exception e) + { + return null; + } + } +} Index: modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java (date 1453208487000) +++ modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java (revision ) @@ -80,6 +80,7 @@ import org.jboss.wsf.stack.cxf.Messages; import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper; import org.jboss.wsf.stack.cxf.client.Constants; +import org.jboss.wsf.stack.cxf.client.configuration.FaultUtils; import org.jboss.wsf.stack.cxf.client.configuration.FeatureUtils; import org.jboss.wsf.stack.cxf.client.configuration.InterceptorUtils; import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory; @@ -239,6 +240,12 @@ binding.setMTOMEnabled(true); } } + + /** + * add by wuhuaxu@renwey.com + */ + FaultUtils.setFaultListener(bus, props); + configured = true; } \ No newline at end of file