cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Adding interceptors to an SEI implementation class
Date Thu, 15 Nov 2007 18:24:07 GMT

Glenn,

Spring config is definitely an option.   

For the logging intereptors (or other that have a default constructor and 
no other configuration needed), you can use interceptors on the SEI 
interface (or impl).

@Features(features = "org.apache.cxf.feature.LoggingFeature")

or 

@InInterceptors(interceptors 
= "org.apache.cxf.interceptor.LoggingInInterceptor")




Dan


On Thursday 15 November 2007, Glen Mazza wrote:
> Team,
>
> The code for adding interceptors to a web service is shown on this
> page[1] as follows:
>
> ---------------------------------------------------
>
> import javax.xml.ws.Endpoint;
> import org.apache.cxf.interceptor.LoggingInInterceptor;
> import org.apache.cxf.interceptor.LoggingOutInterceptor;
> import org.apache.cxf.jaxws.EndpointImpl;
>
> EndpointImpl ep = (EndpointImpl)
> Endpoint.publish("http://localhost/service", service);
>
> ep.getServer().getEndpoint().getInInterceptors().add(new
> LoggingInInterceptor());
> ep.getServer().getEndpoint().getOutInterceptors().add(new
> LoggingOutInterceptor());
>
> ----------------------------------------------------
>
> Question: If I am not creating a web service is this manner, but am
> instead just implementing an SEI created from wsdl2java (to be wrapped
> up in a servlet WAR file), then I *cannot* add interceptors
> programmically as above--in this case, I would have to use
> configuration files, correct?
>
> Just want to clarify this point for the documentation.
>
> Thanks,
> Glen
>
> [1] http://cwiki.apache.org/confluence/display/CXF20DOC/Debugging



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message