WSO2 ESB>管理来自代理的端点文本响应(预期prolog中的意外字符'some_character'代码45'<')

时间:2017-12-22 13:11:36

标签: text proxy wso2 response axis2

我正在通过SOAPUI

中的ESB6.1.1对端点服务进行soap调用
PROXY CONFIGURATION
 ((( I bloted out some information with xxxx )))

<?xml version="1.0" encoding="UTF-8"?><proxy xmlns="http://ws.apache.org/ns/synapse" name="xxxxWsV2_Based_Proxy" startOnLoad="true" statistics="disable" trace="enable" transports="http,https">
    <target>
        <inSequence>
            <property name="FORCE_HTTP_1.0" scope="axis2" type="STRING" value="true"/>
            <property name="DISABLE_CHUNKING" scope="axis2" type="STRING" value="true"/>
            <property name="EXPECT-100" scope="axis2" type="STRING" value="true"/>
            <log level="full"/>
        </inSequence>
        <outSequence>
            <log level="full"/>
            <send/>
        </outSequence>
        <endpoint>
            <wsdl port="xxxxWsV2Port" service="xxxxxWsV2Service" uri="file:/var/www/html/xxxxWsV2.wsdl"/>
        </endpoint>
    </target>
    <description/>
</proxy>

当端点服务返回“SOAP响应”时,SOAPUI会收到正确的响应。

但是我还有其他的肥皂调用正在返回下一个非肥皂格式的响应:

NON-SOAP ENDPOINT RESPONSE
--urn:uuid:ax7xx36-98xx9-4ex1-bxxc-ax1xxxxx8bxc
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <urn:uuid:3xcxxx4b-x9ea-xxf6-81c3-8a8xxxxe6bx7>

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://xxxx.es/xxxx/ws/xxxxws_v2/1.0/infoEnvioV2">
<SOAP-ENV:Body>
<resultadoInfoEnvioV2>
<ns1:identificador>xa3x2xxxxx8xx7</ns1:identificador>
</resultadoInfoEnvioV2>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

--urn:uuid:a07xxx6-9xxx9-4xxa1-xx9c-a91dxxbcc
Content-Type: application/octet-stream; charset=utf-8
Content-Transfer-Encoding: binary
Content-ID: <urn:uuid:69xxx17b-x96c-xx3e-9x78-721dxxxxxxa23>
http://xx.x.x.xxx/Texto_de_prueba.txt
--urn:uuid:a07xxx6-9xxx9-4ea1-bxxc-a9xxx0c8bcc—

问题是wso2-esb没有返回对SOAPUI的响应,因为这个ESB错误:

TID: [-1234] [] [2017-12-21 17:15:38,305] ERROR {org.apache.synapse.transport.passthru.util.RelayUtils} -  Error while building Passthrough stream {org.apache.synapse.transport.passthru.util.RelayUtils}
org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'

我只对从SOAPUI读取最后一个SOAP-ENV响应感兴趣。

获得解决方案。我想将'PROXY RESPONSE'转换为SOAPUI可以读取的格式。

解决问题。我将属性messageBuilder添加到代理的out-sequence配置中:

NEW OUT-SEQUENCE PROXY CONFIGURATION
        <outSequence>
            <builder>
                <messageBuilder class="org.wso2.carbon.relay.BinaryRelayBuilder" contentType="text/xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
            </builder>
            <log level="full"/>
            <send/>
        </outSequence>

注意:当我添加最后一个属性messageBuilder时。 WSO2编辑器为自己添加了这些新属性:

<outSequence>
    <builder>
        <messageBuilder class="org.apache.axis2.builder.ApplicationXMLBuilder" contentType="application/xml" formatterClass="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
        <messageBuilder class="org.apache.axis2.builder.MIMEBuilder" contentType="multipart/related"/>
        <messageBuilder class="org.apache.axis2.builder.SOAPBuilder" contentType="application/soap+xml" formatterClass="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
        <messageBuilder class="org.apache.axis2.json.JSONBuilder" contentType="application/json" formatterClass="org.apache.axis2.json.JSONMessageFormatter"/>
        <messageBuilder class="org.apache.axis2.builder.MTOMBuilder" contentType="application/xop+xml"/>
        <messageBuilder class="org.apache.axis2.builder.XFormURLEncodedBuilder" contentType="application/x-www-form-urlencoded" formatterClass="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
    </builder>
    <log level="full"/>
    <send/>
</outSequence>

但遗憾的是我在SOAPUI中没有得到任何回复:(

在我进行其他测试之后,在outsequence中添加下一个属性。但没有效果:

<property name="ContentType" value="text/xml" scope="axis2"/>
<property name="messageType" value="text/xml" scope="axis2"/>

注意:我一直使用axis2.xml默认文件。

¿你知道我应该在我的代理配置中使用哪个属性来管理这种文本响应吗?

非常感谢

0 个答案:

没有答案