wso2 esb: как я могу вернуть данные из динамических вызовов - PullRequest
0 голосов
/ 30 сентября 2019

У меня есть адрес http://www.mocky.io/v2/5d8d17b42e00006a00abdedd, и мне нужно вызвать все ссылки массива. Также мне нужно объединить результаты всех ссылок в адрес. Все результаты запроса отображаются в журналах, но я не могу отправить их клиенту в запросе.

У меня есть прокси

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="listAllEmail"
       startOnLoad="true"
       statistics="enable"
       trace="enable"
       transports="http,https">
   <target>
      <inSequence>
         <property name="Person" scope="default">
            <response xmlns=""/>
         </property>             
         <property name="HTTP_METHOD" scope="axis2" type="STRING" value="POST"/>            
         <call blocking="true">
            <endpoint>
               <http method="GET"
                     uri-template="http://www.mocky.io/v2/5d8d17b42e00006a00abdedd"/>
            </endpoint>
         </call>
         <iterate continueParent="true"
                  expression="$body//jsonArray/jsonElement"
                  id="NIRO">
            <target>
               <sequence>
                  <property expression="$body/jsonElement//link" name="uri.var.host"/>>
                  <call>
                     <endpoint>
                        <http method="POST" uri-template="{uri.var.host}"/>
                     </endpoint>
                  </call>
                  <enrich>
                     <source clone="true" type="body"/>
                     <target property="Person" type="property"/>
                  </enrich>
                  <property expression="$body/child::node()"
                            name="PROPERTY_PROPERTY"
                            scope="default"/>
                  <enrich>
                     <source clone="true" property="Person" type="property"/>
                     <target action="sibling" type="body"/>
                  </enrich>
               </sequence>
            </target>
         </iterate>
         <property name="Aggregated_Responses" scope="default">
            <jsonObject/>
         </property>
      </inSequence>
      <outSequence>
         <aggregate description="" id="NIRO">
            <completeCondition timeout="10">
               <messageCount max="2" min="1"/>
            </completeCondition>
            <onComplete xmlns:ns="http://echo.services.core.carbon.wso2.org"
                        enclosingElementProperty="Aggregated_Responses"
                        expression="$body//jsonArray/jsonElement">
               <send/>
            </onComplete>
         </aggregate>
      </outSequence>
      <faultSequence/>
   </target>
   <description/>
</proxy>              

И я не могу вернуть и агрегировать результатэтого.

...