0

我创建了一个骡流:

http --> 休息 --> Connector1 --> Connector2 --> ResponseBack

在 rest web 服务中,它接受多个参数,将其存储在对象中并将该对象返回给下一个组件。

Connector1 接收对象并将值(有效负载)返回给下一个组件(Connector2)。

现在Connector2接收到​​Connector1返回的对象,但是还不够,还需要从rest返回的对象中获取值。怎么做到呢。

4

1 回答 1

0

Before calling the connector one or inside connector one, save the object returned by rest as a flow (invocation) variable.

This way when you reach connector two, you can have both response from connector one and the object returned by rest.

  <set-variable value="#[payload]" variableName="objFromRest"></set-variable>

or

  msg.setInvocationProperty(key, value);

and to retrieve them

  msg.getInvocationProperty(key);

or   #[flowVars['key']]

Refer to the following link for more information of using the Mule Expression Language and using Flow Variables.

Mule Expression Language

于 2013-04-26T16:47:44.583 回答