Hi Rice,

I recently figured out how to extend for a custom class as well. I think you
will find this useful though I can't speak to actually forwarding the
request. I chose the annotation approach but there are other ways to do it.
Please see: 

https://cxf.apache.org/docs/interceptors.html
and
https://cxf.apache.org/docs/configuration.html

Excerpts from the first page referenced above:
----------------------
You can also use annotation to add the interceptors from the SEI or service
class. When CXF create the server or client, CXF will add the interceptor
according with the annotation.

@org.apache.cxf.interceptor.InInterceptors (interceptors =
{"com.example.Test1Interceptor" })
@org.apache.cxf.interceptor.InFaultInterceptors (interceptors =
{"com.example.Test2Interceptor" })
@org.apache.cxf.interceptor.OutInterceptors (interceptors =
{"com.example.Test1Interceptor" })
@org.apache.cxf.interceptor.InFaultInterceptors (interceptors =
{"com.example.Test2Interceptor","com.example.Test3Intercetpor" })
@WebService(endpointInterface =
"org.apache.cxf.javascript.fortest.SimpleDocLitBare",
            targetNamespace = "uri:org.apache.cxf.javascript.fortest")
public class SayHiImplementation implements SayHi {
   public long sayHi(long arg) {
       return arg;
   }
   ...
}

----------------

Adding MyInterceptor to the bus:

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:cxf="http://cxf.apache.org/core";
       xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd";>
 
    <bean id="MyInterceptor" class="demo.interceptor.MyInterceptor"/>
 
    
 
    <cxf:bus>
        <cxf:inInterceptors>
            <ref bean="MyInterceptor"/>
        </cxf:inInterceptors>
        <cxf:outInterceptors>
            <ref bean="MyInterceptor"/>
       </cxf:outInterceptors>
    </cxf:bus>
</beans>
---------------------

Hope this helps while waiting a response from the CXF team.



-----
Regards,
RobCodes
--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Reply via email to