Im using Spring 3.1.0. I have configured a webservice endpoint in my application-context as follows.
<jaxws:client id="MyService" serviceClass="com.example.service.ServiceController" username="${username}" password="${password}" address="${url}">
<jaxws:outInterceptors>
<bean id="MyLoggingOutInterceptor" class="com.example.service.logging.MyLoggingOutInterceptor" />
</jaxws:outInterceptors>
<jaxws:inInterceptors>
<bean id="MyLoggingInInterceptor" class="com.example.service.logging.MyLoggingInInterceptor" />
</jaxws:inInterceptors>
</jaxws:client>
I have created the MyLoggingInInterceptor and MyLoggingOutInterceptor classes to extend org.apache.cxf.interceptor.LoggingInInterceptor and org.apache.cxf.interceptor.LoggingOutInterceptor with something like the following.
public class MyLoggingOutInterceptor extends LoggingOutInterceptor
{
@Autowired
XmlLogMapper XmlLogMapper;
private XMLLog transformToLogObject(String originalLogString)
{
XMLLog log = LoggingUtility.ConvertLog(originalLogString);
return log;
}
/**
* override this method to Change how the message will be logged.
* */
@Override
protected void log(Logger logger, String message)
{
XMLLog Log = transformToLogObject(message);
XmlLogMapper.insertSelective(Log);
}
}
When i run the code all my outgoing requests are correctly logged into my database as expected. however the responses are just printed to the console and my MyLoggingInInterceptor is not called. Both classes are exactly the same bar the names. Is there some further configuration i require?
I placed a constructor in my MyLoggingInInterceptor and its being initialised on startup by the Spring Config, so its being called
Aucun commentaire:
Enregistrer un commentaire