You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Apostolos Papageorgiou <ap...@kom.tu-darmstadt.de> on 2010/07/26 13:18:44 UTC

Using Compression

Hello,

I am using tuscany 1.4 with the embedded tomcat and the WS binding for providing my services.
The WS clients may be "non-SCA", i.e., "non-tuscany" programs.
Can I activate/deactivate compression for my services? Can this be done separately for each service? How?
Thanks in advance.

Best regards,
Apostolos


Re: Using Compression

Posted by Simon Laws <si...@googlemail.com>.
On Mon, Jul 26, 2010 at 12:18 PM, Apostolos Papageorgiou
<ap...@kom.tu-darmstadt.de> wrote:
> Hello,
>
>
>
> I am using tuscany 1.4 with the embedded tomcat and the WS binding for
> providing my services.
>
> The WS clients may be “non-SCA”, i.e., “non-tuscany” programs.
>
> Can I activate/deactivate compression for my services? Can this be done
> separately for each service? How?
>
> Thanks in advance.
>
>
>
> Best regards,
>
> Apostolos
>
>

Hi Apostolos.

There is currently no bundled support for compression as far as I
know. You could though implement a policy interceptor (or maybe even
and Axis handler) to provide the feature. Both Axis and Tuscany create
a chain of interceptors at the service to process incoming and
outgoing messages. When the WS binding is configured the interceptors
at the service side could look something like..

SOAP/HTTP message --> Axis2 --1--> TuscanyAxis2MessageReceiver --2-->
TuscanyDatabindingInterceptor --> ImplementationInvoker

At point 2 you could add an interceptor to decompress/compress
incoming/outgoing Axiom message elements. With this approach only the
contents of the message body would be compressed and the HTTP header
wouldn't be marked as holding compressed content. This may be
problematic as you say you have non-SCA clients which wouldn't know
what to do with the compressed body.

If this doesn't seem practical at point 1 it may be possible to
configure Axis2 to do something similar. Although doing a quick
Google, Axis compression relies on the underlying Apache HTTP client
and some API configuration parameters. Using those in 1.x would mean
changing our binding implementation.

Are you committed to 1.4? It may be easier to do something like this
on our latest 2.x code base as we've opened up the ws binding
implementation to allow policy interceptor to set the Axis
configuration more easily.

Regards

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com