简体   繁体   English

无效的 UTF-8 起始字节 0x8b(在字符 #2,字节 #-1)Mule ESB 的问题

[英]issue with Invalid UTF-8 start byte 0x8b (at char #2, byte #-1) Mule ESB

I have created Mule ESB project that invokes third party web service using web service consumer.我创建了 Mule ESB 项目,该项目使用 Web 服务使用者调用第三方 Web 服务。

Passing custom security header information using property使用属性传递自定义安全标头信息

Used transformation xslt to transform input message from source to target.使用转换 xslt 将输入消息从源转换为目标。

There is no transformation in output.输出没有转换。 Only DOM to XML node is added in output输出中仅添加了 DOM 到 XML 节点

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)无效的 UTF-8 起始字节 0x8b(在字符 #2,字节 #-1)(java.io.CharConversionException)com.ctc.wstx.io.UTF8Reader:303(空)

  2. Invalid UTF-8 start byte 0x8b (at char #2, byte #-1) (com.ctc.wstx.exc.WstxIOException) com.ctc.wstx.stax.WstxInputFactory:550 (null)无效的 UTF-8 起始字节 0x8b(在字符 #2,字节 #-1)(com.ctc.wstx.exc.WstxIOException)com.ctc.wstx.stax.WstxInputFactory:550(空)

  3. Couldn't parse stream.无法解析流。 (java.lang.RuntimeException) org.apache.cxf.staxutils.StaxUtils:1262 (null) (java.lang.RuntimeException) org.apache.cxf.staxutils.StaxUtils:1262 (null)

  4. Invalid UTF-8 start byte 0x8b (at char #2, byte #-1).无效的 UTF-8 起始字节 0x8b(在字符 #2,字节 #-1)。

This issue may happen if that third party web service that you request to provides gzip-encoded response ie如果您请求的第三方 Web 服务提供 gzip 编码的响应,则可能会发生此问题,即

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.在这种情况下,您需要使用某种拦截器来解码响应。

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.要解决此问题,您需要拦截响应消息并对其进行解码,因为它以gzip编码格式或其他压缩方式传入。

With CXF, it's possible to create a custom interceptor by extending the AbstractPhaseInterceptor class and overriding the handleMessage method.使用 CXF,可以通过扩展AbstractPhaseInterceptor类并覆盖handleMessage方法来创建自定义拦截器。

Then you get the message content, decode and replace it in the same content field as an InputStream .然后您获取消息内容,在与InputStream相同的内容字段中对其进行解码和替换。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UnicodeDecodeError:“utf-8”编解码器无法解码位置 1 的字节 0x8b:无效的起始字节 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte UnicodeDecodeError:&#39;utf-8&#39;编解码器无法解码位置1的字节0x8b - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1 在将 YML 解析为 POJO 时出现异常 Invalid UTF-8 起始字节 0x80(在 char #158,字节 #-1) - while parsing YML to POJO getting exception Invalid UTF-8 start byte 0x80 (at char #158, byte #-1) 无效的utf-8起始字节0xb0 - invalid utf-8 start byte 0xb0 UnicodeDecodeError:&#39;utf-8&#39;编解码器无法解码位置0的字节0x80:无效的起始字节 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte “utf-8”编解码器无法解码位置 928 中的字节 0x93:起始字节无效 - 'utf-8' codec can't decode byte 0x93 in position 928: invalid start byte UnicodeDecodeError: &#39;utf-8&#39; 编解码器无法解码位置 1072 中的字节 0x95:起始字节无效 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x95 in position 1072: invalid start byte Python:UnicodeDecodeError:'utf-8'编解码器无法解码 position 中的字节 0x80 0:无效起始字节 - Python: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte UnicodeDecodeError: &#39;utf-8&#39; 编解码器无法解码位置 3131 中的字节 0x80:起始字节无效 - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte 'utf-8' 编解码器无法解码 position 中的字节 0x80 28:起始字节无效 - 'utf-8' codec can't decode byte 0x80 in position 28: invalid start byte
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM