3

I have created Mule ESB project that invokes third party web service using web service consumer.

Passing custom security header information using property

Used transformation xslt to transform input message from source to target.

There is no transformation in output. Only DOM to XML node is added in output

Can any one provide me solution on this issue?

I am getting the below exception when invoking the service.

Exception stack is:

  1. Invalid UTF-8 start byte 0x8b (at char #2, byte #-1) (java.io.CharConversionException) com.ctc.wstx.io.UTF8Reader:303 (null)

  2. Invalid UTF-8 start byte 0x8b (at char #2, byte #-1) (com.ctc.wstx.exc.WstxIOException) com.ctc.wstx.stax.WstxInputFactory:550 (null)

  3. Couldn't parse stream. (java.lang.RuntimeException) org.apache.cxf.staxutils.StaxUtils:1262 (null)

  4. Invalid UTF-8 start byte 0x8b (at char #2, byte #-1).

2 Answers 2

4

This issue may happen if that third party web service that you request to provides gzip-encoded response i.e.

HTTP/1.1 200 OK
Content-Type: text/xml;charset="utf-8"
Content-Encoding: gzip
Content-Length: 324

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>...

In this case you need to use some kind of interceptor that decodes the response.

0

To solve this, you need to intercept the response message and decode it because it's incoming in gzip encoding format, or another compression way.

With CXF, it's possible to create a custom interceptor by extending the AbstractPhaseInterceptor class and overriding the handleMessage method.

Then you get the message content, decode and replace it in the same content field as an InputStream.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.