The @GZIP
annotation is defined by the
org.apache.cxf.annotations.GZIP
interface. It is placed
on the SEI.
Enables GZIP compression of messages. GZIP is a negotiated enhancement. That is, an
initial request from a client will not be gzipped, but an Accept
header will be
added and, if the server supports GZIP compression, the response will be gzipped and any
subsequent requests will be also.
Table 1.10 shows the optional properties
supported by the @GZIP
annotation.
Table 1.10. @GZIP Properties
Property | Description |
---|---|
threshold | Messages smaller than the size specified by this property are not gzipped. Default is -1 (no limit). |
The @FastInfoset
annotation is defined by the
org.apache.cxf.annotations.FastInfoset
interface. It is
placed on the SEI.
Enables the use of FastInfoset format for messages. FastInfoset is a binary encoding format for XML, which aims to optimize both the message size and the processing performance of XML messages. For more details, see the following Sun article on Fast Infoset.
FastInfoset is a negotiated enhancement. That is, an initial request from a client will
not be in FastInfoset format, but an Accept
header will be added and, if the
server supports FastInfoset, the response will be in FastInfoset and any subsequent requests
will be also.
Table 1.11 shows the optional properties
supported by the @FastInfoset
annotation.
Table 1.11. @FastInfoset Properties
Property | Description |
---|---|
force | A boolean property that forces the use of FastInfoset format, instead of
negotiating. When true , force the use of FastInfoset format; otherwise,
negotiate. Default is false . |
Example 1.13 shows how to enable GZIP
compression for the HelloWorld
SEI.
Example 1.13. Enabling GZIP
@WebService @GZIP public interface HelloWorld { String sayHi(@WebParam(name = "text") String text); }
Example 1.14 shows how to enable the
FastInfoset format for the HelloWorld
SEI.
Example 1.14. Enabling FastInfoset
@WebService @FastInfoset public interface HelloWorld { String sayHi(@WebParam(name = "text") String text); }