我有一个全路由消息处理器,我从客户端向多个外部服务发送请求,我可以发送请求,我得到响应,但响应看起来有点奇怪:
<java.util.concurrent.CopyOnWriteArrayList serialization="custom">
<java.util.concurrent.CopyOnWriteArrayList>
<default/>
<int>2</int>
<byte-array>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IS0tIFB1Ymxpc2hlZCBieSBK
QVgtV1MgUkkgYXQgaHR0cDovL2pheC13cy5kZXYuamF2YS5uZXQuIFJJJ3MgdmVyc2lvbiBpcyBK
QVgtV1MgUkkgMi4xLjYuIC0tPjwhLS0gR2VuZXJhdGVkIGJ5IEpBWC1XUyBSSSBhdCBodHRwOi8v
amF4LXdzLmRldi5qYXZhLm5ldC4gUkkncyB2ZXJzaW9uIGlzIEpBWC1XUyBSSSAyLjEuNi4gLS0+
PGRlZmluaXRpb25zIHhtbG5zOnNvYXA9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzZGwv
c29hcC8iIHhtbG5zOnRucz0iaHR0cDovL21pbml3ZWJzZXJ2aWNlLyIgeG1sbnM6eHNkPSJodHRw
Oi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM9Imh0dHA6Ly9zY2hlbWFzLnhtbHNv
YXAub3JnL3dzZGwvIiB0YXJnZXROYW1lc3BhY2U9Imh0dHA6Ly9taW5pd2Vic2VydmljZS8iIG5h
bWU9IkhhbGxvV2VsdEltcGxTZXJ2aWNlIj4KPHR5cGVzPgo8eHNkOnNjaGVtYT4KPHhzZDppbXBv
cnQgbmFtZXNwYWNlPSJodHRwOi8vbWluaXdlYnNlcnZpY2UvIiBzY2hlbWFMb2NhdGlvbj0iaHR0
cDovL2xvY2FsaG9zdDo0NDM1L21pbml3ZWJzZXJ2aWNlL21pbml3ZWJzZXJ2aWNlP3hzZD0xIi8+
CjwveHNkOnNjaGVtYT4KPC90eXBlcz4KPG1lc3NhZ2UgbmFtZT0iaGFsbG8iPgo8cGFyd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UvbWluaXdlYnNlcnZpY2UiLz4KPC9wb3J0
GlvbnM+</byte-array> Pgo8L3NlcnZpY2U+CjwvZGVmaW5pdGlvbnM+</byte-array>
</java.util.concurrent.CopyOnWriteArrayList>
</java.util.concurrent.CopyOnWriteArrayList>
有任何建议如何解决这个问题?
更新:
这是我目前的配置:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.2.1" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/current/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/current/mule-tcp.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd ">
<flow name="flows1Flow1" doc:name="flows1Flow1">
<http:inbound-endpoint exchange-pattern="request-response" address="http://localhost:4433/miniwebservice" mimeType="text/xml" doc:name="HTTP"/>
<logger level="INFO" category="ddo" doc:name="Logger"/>
<all doc:name="All">
<processor-chain>
<message-properties-transformer mimeType="text/xml" doc:name="Message Properties">
<add-message-property key="http.method" value="#[header:INBOUND:http.method]"/>
</message-properties-transformer>
<http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4435/miniwebservice#[header:INBOUND:http.request]" mimeType="text/xml" doc:name="HTTP"/>
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace.xsl" doc:name="XSLT"/>
</processor-chain>
<processor-chain>
<message-properties-transformer mimeType="text/xml" doc:name="Message Properties">
<add-message-property key="http.method" value="#[header:INBOUND:http.method]"/>
</message-properties-transformer>
<http:outbound-endpoint exchange-pattern="request-response" address="http://localhost:4434/miniwebservice#[header:INBOUND:http.request]" mimeType="text/xml" doc:name="HTTP"/>
<mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="C:\Users\kiesa\Desktop\XSLReplace2.xsl" doc:name="XSLT"/>
</processor-chain>
</all>
<custom-aggregator failOnTimeout="true" class="customJavaClass" doc:name="Custom Aggregator"/>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
</flow>
</mule>
答案 0 :(得分:1)
这里没有什么可解决的:All Routing Message Processor的结果是从对每个消息处理器内的每个消息处理器接收的有效负载的java.util.List。
您必须在某处配置对象到xml的转换:这就是使用XStream驱动的序列化将List有效内容转换为XML的原因。
您需要处理此列表,例如使用可以处理java.util.List有效内容的自定义组件。