cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, Jervis" <j...@iona.com>
Subject RE: Gzip encoding
Date Mon, 05 Nov 2007 03:02:41 GMT
Hi Shaw, you can configure your client side interceptors using feature. An example can be found
from dispatch system test: \trunk\systests\src\test\java\org\apache\cxf\systest\dispatch\TestDispatchFeature.java
and client-config.xml.

Cheers,
Jervis

> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: 2007?11?3? 1:43
> To: cxf-user@incubator.apache.org
> Cc: Shaw, Richard A
> Subject: Re: Gzip encoding
> 
> 
> 
> Hmm...   not really sure how to add it to the dispatch style suff via 
> spring.   Interesting.   
> 
> That said, bus level might make sense if the interceptor was 
> updated to 
> handle the case where it's not gzip as well.   
> Basically, "Accept-Encoding" is a hint and the server may not 
> respond in 
> gzip form.   Thus, the interceptor should check the request 
> header and 
> if the headers don't say it's gzipped, skip it. 
> 
> The interceptor may also need to reset the Message.CONTENT_TYPE and 
> Message.ENCODING properties.   Not really sure though.
> 
> Dan
> 
> 
> On Friday 02 November 2007, Shaw, Richard A wrote:
> > In reply to my previous message I can see that there is an example
> > interceptor to GZIP. I've copied this but now I don't know 
> how to add
> > it to my dispatch call.
> >
> > The example adds it to the bus, but I have other services on the bus
> > which are not using GZIP.
> >
> > I've found an example that adds it to a jaxws:client but it needs a
> > serviceClass and I don't have one because I'm using the dispatch
> > interface.
> >
> > Can anybody help. Ideally I'd like to add it to my spring 
> config. But
> > if I have to add it to my code I can live with that to get 
> it working.
> >
> > Thanks
> >
> >
> > Richard Shaw
> >
> > ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤
> ø,¸¸,ø¤
> >
> > Richard Shaw
> > Technical Design Authority - Information Solutions Consultancy
> > Intelligent Transport Systems
> >
> > Atkins Highways and Transportation
> > Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
> >
> > Tel: +44 (0) 1372 756407
> > Fax: +44 (0) 1372 740055
> > Mob: 07740 817586
> > E-mail: richard.shaw@atkinsglobal.com
> >
> > www.atkinsglobal.com/its
> >
> > -----Original Message-----
> > From: Shaw, Richard A [mailto:richard.shaw@atkinsglobal.com]
> > Sent: 02 November 2007 11:23
> > To: cxf-user@incubator.apache.org
> > Subject: Gzip encoding
> >
> > I'm using the dispatch interface to request data from a web service
> > which returns the data in gzip format.
> >
> > Can CXF handle this ? I've set the Accept-Encoding to gzip 
> and can see
> > the compressed data being received (using Ethereal) but I get the
> > following error -
> >
> > org.apache.cxf.interceptor.Fault: Unable to create envelope 
> from given
> > source: at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchInInterceptor.handleMessage(
> >DispatchInInterceptor.java:114) at
> > 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:147) at
> > 
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:259) at
> > 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe
> >sponse(HTTPConduit.java:1825) at
> > 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doClose(
> >HTTPConduit.java:1690) at
> > 
> org.apache.cxf.io.AbstractCachedOutputStream.close(AbstractCachedOutpu
> >tStream.java:114) at
> > 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66
> >) at
> > 
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin
> >gInterceptor.handleMessage(MessageSenderInterceptor.java:62) at
> > 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:147) at
> > org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:146) at
> > org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:104) at
> > 
> com.atkinsglobal.mosaic.datafetch.DataFetchUtils.test(DataFetchUtils.j
> >ava:120) at
> > 
> com.atkinsglobal.mosaic.datafetch.PollDataFetchServer.main(PollDataFet
> >chServer.java:24) Caused by:
> > com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create
> > envelope from given source: at
> > 
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> >eFactory.java:114) at
> > 
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeF
> >romSource(SOAPPart1_1Impl.java:71) at
> > 
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.
> >java:125) at
> > 
> com.sun.xml.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.ja
> >va:1237) at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchInInterceptor.handleMessage(
> >DispatchInInterceptor.java:89) ... 12 more
> > Caused by: javax.xml.transform.TransformerException:
> > org.xml.sax.SAXParseException: Content is not allowed in prolog. at
> > 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transfo
> >rmerIdentityImpl.java:501) at
> > 
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransforme
> >r.transform(EfficientStreamingTransformer.java:390) at
> > 
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> >eFactory.java:102) ... 16 more
> > Caused by: org.xml.sax.SAXParseException: Content is not allowed in
> > prolog. at
> > 
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abs
> >tractSAXParser.java:1269) at
> > org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) at
> > 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transfo
> >rmerIdentityImpl.java:484) ... 18 more
> > Exception in thread "main" java.lang.RuntimeException:
> > org.apache.cxf.interceptor.Fault: Unable to create envelope 
> from given
> > source: at
> > 
> org.apache.cxf.jaxws.DispatchImpl.waitResponse(DispatchImpl.java:204)
> > at 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:181) at
> > org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:104) at
> > 
> com.atkinsglobal.mosaic.datafetch.DataFetchUtils.test(DataFetchUtils.j
> >ava:120) at
> > 
> com.atkinsglobal.mosaic.datafetch.PollDataFetchServer.main(PollDataFet
> >chServer.java:24) Caused by: org.apache.cxf.interceptor.Fault: Unable
> > to create envelope from given source: at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchInInterceptor.handleMessage(
> >DispatchInInterceptor.java:114) at
> > 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:147) at
> > 
> org.apache.cxf.jaxws.DispatchImpl.onMessage(DispatchImpl.java:259) at
> > 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRe
> >sponse(HTTPConduit.java:1825) at
> > 
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doClose(
> >HTTPConduit.java:1690) at
> > 
> org.apache.cxf.io.AbstractCachedOutputStream.close(AbstractCachedOutpu
> >tStream.java:114) at
> > 
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66
> >) at
> > 
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndin
> >gInterceptor.handleMessage(MessageSenderInterceptor.java:62) at
> > 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> >rChain.java:147) at
> > 
> org.apache.cxf.jaxws.DispatchImpl.invoke(DispatchImpl.java:146) ... 3
> > more
> > Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to
> > create envelope from given source: at
> > 
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> >eFactory.java:114) at
> > 
> com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeF
> >romSource(SOAPPart1_1Impl.java:71) at
> > 
> com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.
> >java:125) at
> > 
> com.sun.xml.messaging.saaj.soap.MessageImpl.getSOAPBody(MessageImpl.ja
> >va:1237) at
> > 
> org.apache.cxf.jaxws.interceptors.DispatchInInterceptor.handleMessage(
> >DispatchInInterceptor.java:89) ... 12 more
> > Caused by: javax.xml.transform.TransformerException:
> > org.xml.sax.SAXParseException: Content is not allowed in prolog. at
> > 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transfo
> >rmerIdentityImpl.java:501) at
> > 
> com.sun.xml.messaging.saaj.util.transform.EfficientStreamingTransforme
> >r.transform(EfficientStreamingTransformer.java:390) at
> > 
> com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(Envelop
> >eFactory.java:102) ... 16 more
> > Caused by: org.xml.sax.SAXParseException: Content is not allowed in
> > prolog. at
> > 
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Abs
> >tractSAXParser.java:1269) at
> > org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:333) at
> > 
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(Transfo
> >rmerIdentityImpl.java:484) ... 18 more
> >
> > I assume this because it is trying to interpret gzip data 
> as XML. Do I
> > need to add an interceptor to do the decoding ?
> >
> > Richard Shaw
> >
> > ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°`°º¤
> ø,¸¸,ø¤
> >
> > Richard Shaw
> > Technical Design Authority - Information Solutions Consultancy
> > Intelligent Transport Systems
> >
> > Atkins Highways and Transportation
> > Woodcote Grove, Ashley Road, Epsom, Surrey, KT18 5BW
> >
> > Tel: +44 (0) 1372 756407
> > Fax: +44 (0) 1372 740055
> > Mob: 07740 817586
> > E-mail: richard.shaw@atkinsglobal.com
> >
> > www.atkinsglobal.com/its
> >
> >
> >
> > This email and any attached files are confidential and copyright
> > protected. If you are not the addressee, any dissemination of this
> > communication is strictly prohibited. Unless otherwise expressly
> > agreed in writing, nothing stated in this communication shall be
> > legally binding.
> >
> > The ultimate parent company of the Atkins Group is WS Atkins plc. 
> > Registered in England No. 1885586.  Registered Office 
> Woodcote Grove,
> > Ashley Road, Epsom, Surrey KT18 5BW.
> >
> > Consider the environment. Please don't print this e-mail unless you
> > really need to.
> >
> >
> > This message has been scanned for viruses by MailControl - (see
> > http://bluepages.wsatkins.co.uk/?6875772)
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Mime
View raw message