简体   繁体   English

WSO2 EI,带代理服务的 While 循环

[英]WSO2 EI, While loop with Proxy Service

I'm trying to loop through Response( jsonarray ) from Data service to call another service using previous each response field (for example userID)我正在尝试通过数据服务中的 Response( jsonarray )循环使用之前的每个响应字段(例如 userID)调用另一个服务

So i manipulate these 2 service's response into Main response to return to client, it will be JsonArray所以我将这两个服务的响应操纵为主要响应以返回给客户端,它将是 JsonArray

Please refer below questions:请参考以下问题:

  1. Is it possible to create ArrayList and put some property(mediator) data in Loop?是否可以创建 ArrayList 并将一些属性(中介)数据放入循环中?
  2. How to implement properly while loop (iterator or foreach mediator)?如何正确实现while循环(迭代器或foreach调解器)?

Note: Basically, i am trying to use service orchestration But Loop is required, i need each services response and fields to be mixed for response

How to do that?怎么做?

You can use the Iterate mediator and the Aggregate mediator in WSO2 EI.您可以在 WSO2 EI 中使用 Iterate 介体和 Aggregate 介体。 Both support jsonpath expressions hence you can manipulate and read the responses as you want.两者都支持 jsonpath 表达式,因此您可以根据需要操作和读取响应。 Please refer to the below blog for an example.请参阅以下博客的示例。

https://medium.com/@arunans23/iterate-over-json-payload-with-wso2-enterprise-integrator-8ccb9cdd2c70 https://medium.com/@arunans23/iterate-over-json-payload-with-wso2-enterprise-integrator-8ccb9cdd2c70

When implementing your feature if you get more specific issues please post them here.在实现您的功能时,如果您遇到更具体的问题,请在此处发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM