错误:丰富中介 要插入消息正文的无效对象类型
尝试丰富消息时,这是代理配置:
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Database" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<dblookup>
<connection>
<pool>
<password>1234</password>
<user>root</user>
<url>jdbc:mysql://localhost:3306/new_db</url>
<driver>com.mysql.jdbc.Driver</driver>
</pool>
</connection>
<statement>
<sql>select * from users where name="rik"</sql>
<result name="client_expiration" column="expiration" />
<result name="client_id" column="id" />
<result name="client_name" column="name" />
</statement>
</dblookup>
<log level="custom">
<property name="returned value for client_expiration is :" expression="get-property('client_expiration')" />
<property name="returned value for client_id is :" expression="get-property('client_id')" />
<property name="returned value for client_name is :" expression="get-property('client_name')" />
</log>
<property name="property1" expression="get-property('client_expiration')" scope="default" />
<enrich>
<source type="property" property="property1" />
<target type="body" action="sibling" />
</enrich>
<sequence key="getback" />
</inSequence>
</target>
</proxy>
和序列配置(但不应该是这里的问题):
<sequence xmlns="http://ws.apache.org/ns/synapse" name="getback">
<header name="To" action="remove" />
<property name="RESPONSE" value="true" scope="default" />
<send />
<log level="full" />
</sequence>
提前谢谢了!!
编辑:日志有效,但消息无效。这是日志文件:
[2012-09-03 09:44:28,853] INFO - LogMediator returned value for client_expirati
on is : = 2012-08-30, returned value for client_id is : = 1, returned value for
client_name is : = rik
[2012-09-03 09:44:28,854] ERROR - EnrichMediator Invalid Object type to be inser
ted into message body
[2012-09-03 09:44:28,856] INFO - LogMediator To: , WSAction: urn:mediate, SOAPA
ction: urn:mediate, MessageID: urn:uuid:f0035921-8b6a-48db-a9a4-78be2687336d, Di
rection: response, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Enve
lope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body /><
/soapenv:Envelope>