Monday, 15 August 2011

java - How to enable compression on the server side with CXF? -



java - How to enable compression on the server side with CXF? -

i'm creating soap webservice client spring , cxf. preferred way enable logging + gzip compression? should 1 utilize annotations or straight add together feature programatically?

@component @webservice @gzip @logging(pretty = true) public class soapservice { }

or

endpointimpl end = new endpointimpl(new springbus(), new soapservice()); loggingfeature feature = new loggingfeature(); feature.setprettylogging(true); end.getfeatures().add(feature); end.getfeatures().add(new gzipfeature()); end.publish("/soapservice");

does matter? prefer?

as far logging concerned, the apache cxf documentation contains following:

logging activated utilize of separate in/out interceptors can attached client and/or service required. these interceptors can specified either programmatically (via java code and/or annotations) or via utilize of configuration files.

configuration files best. offer 2 benefits on programmatic configuration:

logging requirements can altered without needing recompile code no apache cxf-specific apis need added code, helps remain interoperable other jax-ws compliant web service stacks

so looks preferred way enable logging utilize configuration (=spring configuration file), should ok seeing planning on using cfx+spring. think same reasoning apply enabling gzip compression.

java spring web-services soap cxf

No comments:

Post a Comment