cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pieper, Aaron" <Piep...@Pragmatics.com>
Subject Injecting a LoggingFeature with org.apache.cxf.jaxws.ServiceImpl?
Date Thu, 04 Apr 2013 14:19:02 GMT
We're using CXF 2.7.1. We have some code which contacts a web service
using a proxy. The proxy is initialized like this:

 

W3CEndpointReferenceBuilder w3cerBuilder = new
W3CEndpointReferenceBuilder();

w3cerBuilder.address(myAddress);

W3CEndpointReference w3ceReference = w3cerBuilder.build();

MessagingManager messagingManager =
w3ceReference.getPort(MessagingManager.class, new AddressingFeature());

 

We want to add a LoggingFeature to this proxy, so that we can monitor
the SOAP messages which get sent/received. Unfortunately, it looks like
this feature list is initialized, and immediately consumed, during lines
407-410 in
org.apache.cxf.jaxws.ServiceImpl.createPort(QName,EndpointReferenceType,
Class<T>,WebServiceFeature...):

 

JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();

JaxWsClientFactoryBean clientFac = (JaxWsClientFactoryBean)
proxyFac.getClientFactoryBean();

JaxWsServiceFactoryBean serviceFactory = (JaxWsServiceFactoryBean)
proxyFac.getServiceFactory();

proxyFac.initFeatures();

 

Our stack trace looks something like this:

 

W3CEndpointReference(EndpointReference).getPort(Class<T>,
WebServiceFeature...) line: 158              

ProviderImpl(ProviderImpl).getPort(EndpointReference, Class<T>,
WebServiceFeature...) line: 374        

ServiceImpl.getPort(EndpointReference, Class<T>, WebServiceFeature...)
line: 711        

 

So, we call W3CEndpointReference.getPort(), which delegates to these
other classes, and eventually to ServiceImpl.getPort(). Within
ServiceImpl.getPort(), the JaxWsProxyFactoryBean is initialized, then
the features are immediately initialized -- it doesn't look like we ever
get an opportunity to specify our own feature list. Is this by design?
Is there a better way for us to inject our LoggingFeature here? I think
we can enable logging by manually adding our own logging interceptors,
but it's a little clumsier that way.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message