Soap wso2 ESB:克隆和聚合超时

Soap wso2 ESB:克隆和聚合超时,soap,wso2,clone,aggregate,esb,Soap,Wso2,Clone,Aggregate,Esb,我尝试在WSO2 ESB中同时使用代理和API来测试将类似的SOAP web服务聚合到一个响应中,但我只是遇到了超时。为了进行测试,我使用了一个weatherweb服务()。我基本上调用同一个操作GetCityWeatherByZIP两次,方法是使用克隆中介为每个操作提供不同的邮政编码,然后聚合结果。最终的目的是调用托管在不同服务器上的web服务,但目前我正在尝试使用相同的服务。如果能得到任何帮助,我将不胜感激 以下是代理配置: <?xml version="1.0" encoding=

我尝试在WSO2 ESB中同时使用代理和API来测试将类似的SOAP web服务聚合到一个响应中,但我只是遇到了超时。为了进行测试,我使用了一个weatherweb服务()。我基本上调用同一个操作GetCityWeatherByZIP两次,方法是使用克隆中介为每个操作提供不同的邮政编码,然后聚合结果。最终的目的是调用托管在不同服务器上的web服务,但目前我正在尝试使用相同的服务。如果能得到任何帮助,我将不胜感激

以下是代理配置:

 <?xml version="1.0" encoding="UTF-8"?>
   <proxy xmlns="http://ws.apache.org/ns/synapse"
       name="aggre"
       transports="http"
       statistics="disable"
       trace="enable"
       startOnLoad="true">
      <target>
      <inSequence>
         <clone>
            <target>
               <sequence>
                  <payloadFactory media-type="xml">
                     <format>
                        <m0:GetCityWeatherByZIP xmlns:m0="http://ws.cdyne.com/WeatherWS/">
                           <m0:ZIP>11001</m0:ZIP>
                        </m0:GetCityWeatherByZIP>
                     </format>
                     <args/>
                  </payloadFactory>
                  <header name="Action" scope="default" value="urn:GetCityWeatherByZIP "/>
                  <call>
                     <endpoint key="weather"/>
                  </call>
               </sequence>
            </target>
            <target>
               <sequence>
                  <payloadFactory media-type="xml">
                     <format>
                        <m0:GetCityWeatherByZIP xmlns:m0="http://ws.cdyne.com/WeatherWS/">
                           <m0:ZIP>11010</m0:ZIP>
                        </m0:GetCityWeatherByZIP>
                     </format>
                     <args/>
                  </payloadFactory>
                  <header name="Action" scope="default" value="urn:GetCityWeatherByZIP "/>
                  <call>
                     <endpoint key="weather"/>
                  </call>
               </sequence>
            </target>
         </clone>
         <aggregate>
            <completeCondition>
               <messageCount min="-1" max="-1"/>
            </completeCondition>
            <onComplete xmlns:m0="http://ws.cdyne.com/WeatherWS"
                        expression="/m0:GetCityWeatherByZIPResponse">
               <drop/>
            </onComplete>
         </aggregate>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
      </target>
      <description/>
   </proxy>

调用中介依赖于非阻塞传输:编辑repository/conf/nhttp.properties并添加
http.socket.timeout.sender=60000如果您同意等待60秒

SOAP操作不正确,则必须是
http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP

聚合的onComplete xpath表达式的命名空间不正确,结尾缺少“/”:
http://ws.cdyne.com/WeatherWS/

聚合后,您不希望删除消息,而是希望将其作为响应发送:在“onComplete”中介中将
替换为

响应将是一条soap消息,soap主体必须有一个根节点作为第一个子节点,因此您必须应用转换,例如:

<payloadFactory media-type="xml">
  <format>
    <response>
      $1
     </response>
  </format>
  <args>
    <arg evaluator="xml" xmlns:m0="http://ws.cdyne.com/WeatherWS/" expression="//m0:GetCityWeatherByZIPResponse"/>
  </args>
</payloadFactory>
终点:

<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="weather">
   <wsdl service="Weather"
         port="WeatherSoap"
         uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
</endpoint>

我得到的答复是:

<response xmlns="http://ws.apache.org/ns/synapse">
<GetCityWeatherByZIPResponse xmlns="http://ws.cdyne.com/WeatherWS/">
<GetCityWeatherByZIPResult>
<Success>true</Success>
<ResponseText>City Found</ResponseText>
<State>NY</State>
<City>Franklin Square</City>
<WeatherStationCity>Farmingdale</WeatherStationCity>
<WeatherID>14</WeatherID>
<Description>Cloudy</Description>
<Temperature>73</Temperature>
<RelativeHumidity>78</RelativeHumidity>
<Wind>S6</Wind>
<Pressure>29.75R</Pressure>
<Visibility/>
<WindChill/>
<Remarks/>
</GetCityWeatherByZIPResult>
</GetCityWeatherByZIPResponse>
<GetCityWeatherByZIPResponse xmlns="http://ws.cdyne.com/WeatherWS/">
<GetCityWeatherByZIPResult>
<Success>true</Success>
<ResponseText>City Found</ResponseText>
<State>NY</State>
<City>Floral Park</City>
<WeatherStationCity>Farmingdale</WeatherStationCity>
<WeatherID>14</WeatherID>
<Description>Cloudy</Description>
<Temperature>73</Temperature>
<RelativeHumidity>78</RelativeHumidity>
<Wind>S6</Wind>
<Pressure>29.75R</Pressure>
<Visibility/>
<WindChill/>
<Remarks/>
</GetCityWeatherByZIPResult>
</GetCityWeatherByZIPResponse>
</response>

真的
城市发现
纽约
富兰克林广场
法明代尔
14
多云
73
78
中六
29.75R
真的
城市发现
纽约
花卉公园
法明代尔
14
多云
73
78
中六
29.75R

谢谢,但我更改了配置,但仍然超时。Tbh,我不需要使用呼叫中介。但是我试着用克隆来发送和不发送或呼叫;我也试着把聚合放在后面。但无论我做什么,我总是有暂停。这很奇怪,因为weather web服务在使用Payload factory和Send(无克隆和聚合)调用一次时,我会在几秒钟内得到响应。所以这里有一个非常错误的地方,我找不到。我还能做什么?非常感谢。它起作用了,你帮助我理解我做错了什么:)我在做同样的事情,但我在克隆中使用了两个不同的端点。我用了呼叫调停者,它甚至没有进入外部序列。这是在浪费时间。。你能在这方面帮我吗?试试SoapUI,看看你是否得到响应,并测量响应时间
<?xml version="1.0" encoding="UTF-8"?>
   <proxy xmlns="http://ws.apache.org/ns/synapse"
       name="TestSOF"
       transports="http"
       statistics="disable"
       trace="enable"
       startOnLoad="true">
      <target>
      <inSequence>
         <clone continueParent="true">
            <target>
               <sequence>
                  <payloadFactory media-type="xml">
                     <format>
                        <m0:GetCityWeatherByZIP xmlns:m0="http://ws.cdyne.com/WeatherWS/">
                           <m0:ZIP>11001</m0:ZIP>
                        </m0:GetCityWeatherByZIP>
                     </format>
                     <args/>
                  </payloadFactory>
                  <header name="Action" scope="default" value="http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"/>
                  <call>
                     <endpoint key="weather"/>
                  </call>
               </sequence>
            </target>
            <target>
               <sequence>
                  <payloadFactory media-type="xml">
                     <format>
                        <m0:GetCityWeatherByZIP xmlns:m0="http://ws.cdyne.com/WeatherWS/">
                           <m0:ZIP>11010</m0:ZIP>
                        </m0:GetCityWeatherByZIP>
                     </format>
                     <args/>
                  </payloadFactory>
                  <header name="Action" scope="default" value="http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"/>
                  <call>
                     <endpoint key="weather"/>
                  </call>
               </sequence>
            </target>
         </clone>
         <filter source="local-name($body/*[1])" regex="GetCityWeatherByZIPResponse">
            <then>
                 <aggregate>
                    <completeCondition>
                       <messageCount min="-1" max="-1"/>
                    </completeCondition>
                    <onComplete xmlns:m0="http://ws.cdyne.com/WeatherWS/"
                                expression="//m0:GetCityWeatherByZIPResponse">
                        <payloadFactory media-type="xml">
                            <format>
                               <response>
                                $1
                               </response>
                            </format>
                            <args>
                               <arg evaluator="xml" xmlns:m0="http://ws.cdyne.com/WeatherWS/" expression="//m0:GetCityWeatherByZIPResponse"/>
                            </args>
                         </payloadFactory>
                         <send/>
                    </onComplete>
                 </aggregate>
            </then>
        </filter>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
      </target>
      <description/>
   </proxy>
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="weather">
   <wsdl service="Weather"
         port="WeatherSoap"
         uri="http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL"/>
</endpoint>
<response xmlns="http://ws.apache.org/ns/synapse">
<GetCityWeatherByZIPResponse xmlns="http://ws.cdyne.com/WeatherWS/">
<GetCityWeatherByZIPResult>
<Success>true</Success>
<ResponseText>City Found</ResponseText>
<State>NY</State>
<City>Franklin Square</City>
<WeatherStationCity>Farmingdale</WeatherStationCity>
<WeatherID>14</WeatherID>
<Description>Cloudy</Description>
<Temperature>73</Temperature>
<RelativeHumidity>78</RelativeHumidity>
<Wind>S6</Wind>
<Pressure>29.75R</Pressure>
<Visibility/>
<WindChill/>
<Remarks/>
</GetCityWeatherByZIPResult>
</GetCityWeatherByZIPResponse>
<GetCityWeatherByZIPResponse xmlns="http://ws.cdyne.com/WeatherWS/">
<GetCityWeatherByZIPResult>
<Success>true</Success>
<ResponseText>City Found</ResponseText>
<State>NY</State>
<City>Floral Park</City>
<WeatherStationCity>Farmingdale</WeatherStationCity>
<WeatherID>14</WeatherID>
<Description>Cloudy</Description>
<Temperature>73</Temperature>
<RelativeHumidity>78</RelativeHumidity>
<Wind>S6</Wind>
<Pressure>29.75R</Pressure>
<Visibility/>
<WindChill/>
<Remarks/>
</GetCityWeatherByZIPResult>
</GetCityWeatherByZIPResponse>
</response>