1 Reply Latest reply on Jul 10, 2019 1:14 AM by Jim Ma

    CXF faultlistener in Wildfly

    Ulab S Newbie

      Hi,

       

      I have need to specify the custom implementation of CXF `FaultListener` in the webservice. The CXF provides following option to do that.

       

      public class MyFaultListener implements org.apache.cxf.logging.FaultListener{
      

       

      cxf-servlet.xml

      <cxf:bus>
      <cxf:properties>
      <entry key="org.apache.cxf.logging.FaultListener">
      <ref bean="myfaultListener" />
      </entry>
      </cxf:properties>
      </cxf:bus>
      

       

       

      But apparently the JBossWS-CXF stack does not take this property in to account. Infact, the cxf-servlet.xml itself is not used by the stack.

      How can I write/define the custom fault listener for CXF in wildfly ?

       

      I can see the `jboss-webservices.xml` supports  <property> but it is limited to interceptors. Is there property support for defining `FaultListener` ?

      jbossws-cxf/Constants.java at master · jbossws/jbossws-cxf · GitHub

        • 1. Re: CXF faultlistener in Wildfly
          Jim Ma Apprentice

          I'll get this support in jboss-webservice.xml and FaultListener can be specified like :

          <?xml version="1.1" encoding="UTF-8"?>

          <webservices

            xmlns="http://www.jboss.com/xml/ns/javaee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            version="1.2"

            xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">

            <property>

            <name>org.apache.cxf.logging.FaultListener</name>

            <value>##faultListner</value>

            </property>

            <property>

            <name>##faultListner</name>

            <value>org.jboss.test.ws.jaxws.cxf.interceptors.JBossWSFaultListener</value>

            </property>

          </webservices>

           

          I already created [JBWS-4176] Support configure property reference - JBoss Issue Tracker and will check in the change very soon.