丰富的中介者要插入到消息正文中的对象类型无效 [英] Enrich mediator Invalid Object type to be inserted into message body
本文介绍了丰富的中介者要插入到消息正文中的对象类型无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ERROR: Enrich mediator Invalid Object type to be inserted into message body
ERROR: Enrich mediator Invalid Object type to be inserted into message body
尝试丰富消息时,这里是代理配置:
when trying to enrich the message, here is the proxy configuration:
<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>
和序列配置(但应该不是这里的问题):
and the sequence configuration (but should not be here the problem):
<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>
非常感谢!
EDIT:日志有效,但消息无效.这是日志文件:
EDIT: the log works but the message doesn't. This is the log file:
[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>
推荐答案
像这样丰富 mediator 并尝试
Have enrich mediator like this and try
<enrich>
<source type="custom" xpath="get-property('property1')"/>
<target type="body" action="sibling"/>
</enrich>
这篇关于丰富的中介者要插入到消息正文中的对象类型无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文