You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by BobbySixKiller <m....@free.fr> on 2012/11/14 14:27:23 UTC

Soap and gzip compression

Hi,

I have some issues with gzip compression and soap requests.

I used apache camel to call a soap webservice using cxf.

When i call myself the ws with the "Accept-Encoding: gzip" header, i've got
the "Content-Encoding" header in response.

But when i call the same soap ws with apache camel i've got no 
"Content-Encoding" header in response.
I 've add the "Accept-Encoding: gzip" header in my route just before the
call to my soap ws and also added the following:
<cxf:features>
	        <bean class="org.apache.cxf.transport.common.gzip.GZIPFeature"/>
	    </cxf:features>

I've got no errors, but how can i be sure the gzip compression is working
since i've got no "Content-Encoding" header ?



--
View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Soap and gzip compression

Posted by Binu Surendran <bi...@ibsplc.com>.
Hi,

You are correct, the below cxf feature enable the use of gzip to compress
the messages on the wire. 

	/<cxf:features>
              <bean
class="org.apache.cxf.transport.common.gzip.GZIPFeature"/>
        </cxf:features>/


Adding above cxf feature to cxf endpoint works fine for me, I am using camel
2.13.0 and cxf-api version 2.7.10. If you enable logging in cxf using
org.apache.cxf.interceptor.LoggingOutInterceptor then you can verify the
value of Accept-Encoding header, find the sample log below;

19Jun,2015 17:15:08,386  INFO
org.apache.cxf.services.XmlSelect.XmlSelectSoap.XmlSelectSoap : - Outbound
Message
---------------------------
ID: 2
Address: https://abc.webservice,com
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml
Headers: {Accept=[*/*], Accept-Encoding=[*gzip*;q=1.0, identity; q=0.5,
*;q=0], .......
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

=================================================================

But you cannot verify the Content-Encoding header from response, because the
GZIPInInterceptor class will remove the Content-Encoding (one of the
protocol headers) header once the response is uncompressed. Eventhough the
webservice sent the compressed message with Content-Encoding=gzip, the
camel/cxf will not hve this header in place. You can verify this by browsing
org.apache.cxf.transport.common.gzip.GZIPInInterceptor class from
cxf-rt-core library.

Hope this calrifies your query.

Thanks,
Binu




--
View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5768399.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Soap and gzip compression

Posted by Christian Müller <ch...@gmail.com>.
Can you check whether Camel sends the "Accept-Encoding: gzip" header to
your web service?

Best,
Christian

On Thu, Nov 15, 2012 at 10:14 AM, Willem jiang <wi...@gmail.com>wrote:

> camel cannot show the HTTP message as it is out of his control.
> It looks like you are try to find out the HTTP header issue, using the
> wireshark could help you to have good check of the header.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>
>
>
>
>
> On Wednesday, November 14, 2012 at 10:52 PM, BobbySixKiller wrote:
>
> > But why use wireshark ? there is no way in apache camel to log and
> verify the
> > Content-Encoding header ?
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5722733.html
> > Sent from the Camel Development mailing list archive at Nabble.com (
> http://Nabble.com).
>
>
>
>


--

Re: Soap and gzip compression

Posted by Willem jiang <wi...@gmail.com>.
camel cannot show the HTTP message as it is out of his control.
It looks like you are try to find out the HTTP header issue, using the wireshark could help you to have good check of the header.


-- 
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang 
Weibo: willemjiang





On Wednesday, November 14, 2012 at 10:52 PM, BobbySixKiller wrote:

> But why use wireshark ? there is no way in apache camel to log and verify the
> Content-Encoding header ?
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5722733.html
> Sent from the Camel Development mailing list archive at Nabble.com (http://Nabble.com).




Re: Soap and gzip compression

Posted by BobbySixKiller <m....@free.fr>.
But why use wireshark ? there is no way in apache camel to log and verify the
Content-Encoding header ?



--
View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5722733.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Soap and gzip compression

Posted by Glen Mazza <gm...@talend.com>.
Best to ask these questions on users@camel.apache.org, this is for 
development of Camel itself. Unless I'm misunderstanding your question, 
you can simply use Wireshark ( 
http://www.jroller.com/gmazza/entry/compressing_soap_messages , 
http://www.jroller.com/gmazza/entry/soap_calls_over_wireshark) to 
determine that GZIP is being used.

Glen

On 11/14/2012 08:27 AM, BobbySixKiller wrote:
> Hi,
>
> I have some issues with gzip compression and soap requests.
>
> I used apache camel to call a soap webservice using cxf.
>
> When i call myself the ws with the "Accept-Encoding: gzip" header, i've got
> the "Content-Encoding" header in response.
>
> But when i call the same soap ws with apache camel i've got no
> "Content-Encoding" header in response.
> I 've add the "Accept-Encoding: gzip" header in my route just before the
> call to my soap ws and also added the following:
> <cxf:features>
> 	        <bean class="org.apache.cxf.transport.common.gzip.GZIPFeature"/>
> 	    </cxf:features>
>
> I've got no errors, but how can i be sure the gzip compression is working
> since i've got no "Content-Encoding" header ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722.html
> Sent from the Camel Development mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: Soap and gzip compression

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use Camel Tracer to log messages
http://camel.apache.org/tracer

And Apache CXF has loggers you can enable to log the SOAP payload.
http://cxf.apache.org/docs/debugging-and-logging.html

See for example the section _Enabling message logging using plain
Spring bean elements_ at
http://cxf.apache.org/docs/configuration.html

.. to use logging interceptors with CXF.


On Thu, Nov 15, 2012 at 9:52 AM, BobbySixKiller <m....@free.fr> wrote:
> my camel version is 2.9.2
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5722765.html
> Sent from the Camel Development mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Soap and gzip compression

Posted by BobbySixKiller <m....@free.fr>.
my camel version is 2.9.2



--
View this message in context: http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722p5722765.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Soap and gzip compression

Posted by Christian Müller <ch...@gmail.com>.
Which version do you use?

Best,
Christian

On Wed, Nov 14, 2012 at 2:27 PM, BobbySixKiller <m....@free.fr> wrote:

> Hi,
>
> I have some issues with gzip compression and soap requests.
>
> I used apache camel to call a soap webservice using cxf.
>
> When i call myself the ws with the "Accept-Encoding: gzip" header, i've got
> the "Content-Encoding" header in response.
>
> But when i call the same soap ws with apache camel i've got no
> "Content-Encoding" header in response.
> I 've add the "Accept-Encoding: gzip" header in my route just before the
> call to my soap ws and also added the following:
> <cxf:features>
>                 <bean
> class="org.apache.cxf.transport.common.gzip.GZIPFeature"/>
>             </cxf:features>
>
> I've got no errors, but how can i be sure the gzip compression is working
> since i've got no "Content-Encoding" header ?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Soap-and-gzip-compression-tp5722722.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>



--