ESB 4.9.0和4.8.1之间的不同行为

时间:2016-02-09 16:39:09

标签: wso2 esb

当我使用SoapUI 5.2.1测试时,我在ESB 4.8.1中有这个代理服务。我遇到了这个问题:

  1. 当超时上升时,不会在服务器控制台中写入完整日志,但是当我将其更改为自定义时,它可以正常工作。
  2. 不向SoapUI返回任何响应(payloadFactory不起作用)
  3. 当我在ESB 4.9.0中部署它时,它可以很好地工作。这是旧版本的错误?我该如何解决?

    <?xml version="1.0" encoding="UTF-8"?>
    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="StockQuoteProxy"
           transports="https,http"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
       <target>
          <inSequence>
             <send>
                <endpoint>
                   <address uri="http://localhost:8089/mockStockQuoteProxySoap11Binding"
                            format="soap11">
                      <timeout>
                         <duration>1000</duration>
                         <responseAction>fault</responseAction>
                      </timeout>
                      <suspendOnFailure>
                         <errorCodes>101500,101501,101506,101507,101508</errorCodes>
                         <initialDuration>2000</initialDuration>
                         <progressionFactor>1.0</progressionFactor>
                         <maximumDuration>3000</maximumDuration>
                      </suspendOnFailure>
                      <markForSuspension>
                         <errorCodes>101504,101505</errorCodes>
                         <retriesBeforeSuspension>3</retriesBeforeSuspension>
                         <retryDelay>1</retryDelay>
                      </markForSuspension>
                   </address>
                </endpoint>
             </send>
          </inSequence>
          <outSequence>
             <send/>
          </outSequence>
          <faultSequence>
             <log level="full">
                <property name="FALLO" value="DETALLES DEL ERROR!!"/>
                <property name="message" expression="get-property('ERROR_MESSAGE')"/>
                <property name="code" expression="get-property('ERROR_CODE')"/>
                <property name="detail" expression="get-property('ERROR_DETAIL')"/>
                <property name="exception" expression="get-property('ERROR_EXCEPTION')"/>
             </log>
           <payloadFactory>
           <format>
             <ns:MyResponse xmlns:ns="http://services.samples">
               <ns:Error>Execution Error</ns:Error>
             </ns:MyResponse>
           </format>
         </payloadFactory>
             <header name="To" action="remove"/>
             <property name="RESPONSE" value="true"/>
             <property name="NO_ENTITY_BODY" scope="axis2" action="remove"/>
             <send/>
          </faultSequence>
       </target>
       <description/>
    </proxy>                  
    

    提前致谢。

2 个答案:

答案 0 :(得分:2)

尝试使用此故障序列: 步骤进行:

  1. 创建我的回复消息。
  2. 使用enrich介体将正文存储在属性中。
  3. 创建错误消息。
  4. 使用rich mediator在属性上覆盖正文。

                                                              

    <payloadFactory>
        <format>
            <ns:getQuoteResponse xmlns:ns="http://services.samples">
                <ns:return xmlns:ax21="http://services.samples/xsd">
                <status>ERROR</status>
                </ns:return>
            </ns:getQuoteResponse>
        </format>
    </payloadFactory>   
    <log level="full">
       <property name="MESSAGE" value="Mensaje despues del payloadFactory"></property>
    </log>  
    <enrich>
       <source clone="true" type="body"></source>
       <target action="replace" type="property" property="OK"></target>
    </enrich>       
      <makefault version="soap11">
        <code xmlns:soap11Env="schemas.xmlsoap.org/soap/envelope/" value="soap11Env:EdnpointTimeout"/>
        <reason value="timeout fault"/>
        <role/>
      </makefault>
    <enrich>
        <source type="property" clone="true" property="OK"/>
        <target type="body"/>
    </enrich>   
    <log level="full">
       <property name="MESSAGE" value="Mensaje despues del enrich"></property>
    </log>          
    <send/>   
    

答案 1 :(得分:0)

当我运行此代理时,这是我得到的响应和控制台日志。你期待这样的事吗?

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Body>
      <ns:MyResponse xmlns:ns="http://services.samples">
         <ns:Error>Execution Error</ns:Error>
      </ns:MyResponse>
   </soap:Body>
</soap:Envelope>

INFO - LogMediator To: /services/StockQuoteProxy.StockQuoteProxyHttpSoap12Endpoint, WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:44da8426-00fc-442a-b4e9-1a9a1dd948f2, Direction: request, FALLO = DETALLES DEL ERROR!!, message = Error connecting to the back end, code = 101503, detail = Error connecting to the back end, exception = null, Envelope: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body></soap:Body></soap:Envelope>