接收到REST调用结果后调用SOAP服务的UTF-8启动字节0x8b无效错误 - WSO2 ESB 4.8.1

时间:2015-07-01 04:58:57

标签: wso2 wso2esb

在WSO2 ESB 4.8.1中实现服务链我们有一个调用REST服务的序列,在接收序列中我们调用SOAP服务。这样做,我们得到以下错误,

<?xml version='1.0' encoding='utf-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body><ns2:Fault xmlns:ns3="http://www.w3.org/2003/05/soap-envelope" xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>ns2:Client</faultcode>
<faultstring>Couldn't create SOAP message due to exception: XML reader error: com.ctc.wstx.exc.WstxIOException: Invalid UTF-8 start byte 0x8b (at char #2, byte #-1)</faultstring>
</ns2:Fault>
</S:Body>
</S:Envelope>[\r][\n]" {org.apache.synapse.transport.http.wire}

无论我们是使用前一个调用的结果作为输入,还是使用PayloadFactory中的实际值进行硬编码,都会发生这种情况。此外,SOAP服务从不接收请求。

当通过ESB或soapUI自行调用SOAP服务时,它可以正常工作。

调用SOAP服务的序列如下,

<template xmlns="http://ws.apache.org/ns/synapse" name="tmpl_get_customer_details">
   <sequence>
      <payloadFactory media-type="xml">
         <format>
            <getCustomer xmlns="http://customer.frontend.ws.utilibill.com.au/">
               <customer xmlns="">
                  <custNo>12965</custNo>
               </customer>
               <login xmlns="">
                  <password>password</password>
                  <userName>username</userName>
               </login>
            </getCustomer>
         </format>
         <args>
            <arg xmlns:ns2="http://org.apache.synapse/xsd" xmlns:ns="http://org.apache.synapse/xsd" expression="$ctx:utilibill_customer_number" evaluator="xml"></arg>
         </args>
      </payloadFactory>
      <log level="full">
         <property name="POSITION" value="tmpl_get_customer_details"></property>
      </log>
      <header name="Action" scope="default" value="http://customer.frontend.ws.utilibill.com.au/UtbCustomer/getCustomerRequest"></header>
      <header name="To" scope="transport" value="http://customer.frontend.ws.utilibill.com.au/UtbCustomer/getCustomerRequest"></header>
      <property name="POST_TO_URI" value="true" scope="axis2" type="STRING"></property>
      <log level="full">
         <property name="POSITION" value="CALLING_CUSTOMER_SERVICE"></property>
      </log>
      <send receive="seq_get_services">
         <endpoint key="UtbCustomer"></endpoint>
      </send>
   </sequence>
</template>

任何人都可以指出可能造成这种情况的原因吗?

0 个答案:

没有答案