IBM App Connect Enterprise-将Path Param传递给Rest Request Node



在IBM App Connect Enterprise REST API项目中,如何将参数的路径传递到REST请求节点?

我可以使用类似的ESQL在计算节点中设置查询参数

SET InputLocalEnvironment.Destination.REST.Request.Parameters.id = 'abc'.

API工作时不会出现任何问题。但是,如果我对路径参数做同样的事情,则不会传递值。作为解决方案,我将值设置为计算节点中的Environment变量,并通过Rest Request node属性中的XPATH获取该值。

有没有类似的方法可以像查询参数一样在ESQL中设置路径参数?

提前谢谢。

所以InputLocalEnvironment为您工作有点惊讶。

对于RESTREQest节点,URL是根据BaseURL和Operation值(您已经找到的Parameters选项(构建的。下面的代码说明了带有Rest节点的环境变量中列出的一些值,这些值可用于覆盖Rest节点的行为。该链接还描述了REST节点完成任务后设置的值。

SET OutputLocalEnvironment.Destination.REST.Request.BaseURL = 'https://my-prod-server.ibm.com/customerdb/v1';
SET OutputLocalEnvironment.Destination.REST.Request.Operation = 'updateCustomerByID';
SET OutputLocalEnvironment.Destination.REST.Request.Parameters.max = 10;
SET OutputLocalEnvironment.Destination.REST.Request.Parameters.filter = 'Fred Bloggs';

请记住将Compute节点配置为具有LocalEnvironmentAndMessage计算模式,否则您的设置将不会传递到后续的RESTREQest节点。

最新更新