2017-01-30 55 views
2

我有一個wso2 esb的問題。 我寫了一個代理,並且我調用了一個端點來對原始輸入進行一些更改。但呼叫之前和呼叫之後的日誌是相同的(它應該是不同的)。看來這個電話根本不起作用。當我發送響應時,它是空的。有誰可以說爲什麼會發生這種情況? (我已經測試我的終點在soupUI)爲什麼呼叫在wso2 esb中不工作

這是我的代理:

 <inSequence> 
    <property name="transport.vfs.ReplyFileName" value="GET" scope="transport"/> 
    <property name="OUT_ONLY" value="true" scope="default" type="STRING"/> 
    <smooks config-key="smooks-csv1"> 
     <input type="text"/> 
     <output type="xml"/> 
    </smooks> 
    <iterate continueParent="true" 
       preservePayload="true" 
       attachPath="//csv-set" 
       expression="//csv-set/search" 
       sequential="true"> 
     <target> 
      <sequence> 
       <xslt key="gov:/first.xsl"/> 
       <xslt key="gov:/second.xsl"/> 
       **<log level="full"/> 
       <call blocking="true"> 
       <endpoint> 
        <address uri="MyEndPiont"/> 
       </endpoint> 
       </call> 
       <log level="full"/>** 
      </sequence> 
     </target> 
    </iterate> 
    <respond/> 
    </inSequence> 
    <outSequence> 
    <aggregate> 
     <completeCondition> 
      <messageCount min="0" max="100"/> 
     </completeCondition> 
     <onComplete expression="//Guest"> 
     </onComplete> 
    </aggregate> 
    </outSequence> 

回答

1

引用試試這個。變更清單:

  • 刪除respond調解員。
  • 通過send替換call
  • 新增send在失序。

    <inSequence> 
        <property name="transport.vfs.ReplyFileName" value="GET" scope="transport"/> 
        <property name="OUT_ONLY" value="true" scope="default" type="STRING"/> 
        <smooks config-key="smooks-csv1"> 
         <input type="text"/> 
         <output type="xml"/> 
        </smooks> 
        <iterate continueParent="true" 
           preservePayload="true" 
           attachPath="//csv-set" 
           expression="//csv-set/search" 
           sequential="true"> 
         <target> 
          <sequence> 
           <xslt key="gov:/first.xsl"/> 
           <xslt key="gov:/second.xsl"/> 
           <log level="full"/> 
           <send> 
           <endpoint> 
            <address uri="MyEndPiont"/> 
           </endpoint> 
           </send> 
          </sequence> 
         </target> 
        </iterate> 
        </inSequence> 
        <outSequence> 
        <aggregate> 
         <completeCondition> 
          <messageCount min="0" max="100"/> 
         </completeCondition> 
         <onComplete expression="//Guest"> 
         </onComplete> 
        </aggregate> 
        <send /> 
        </outSequence> 
    
+0

不幸的是,再次發生這些變化時,我無法看到輸出的結果。它給了我這個錯誤:「錯誤 - VFSTransportSender在附加VFS文件系統屬性時出錯。」空 錯誤 - VFSTransportSender無法確定出傳輸信息來發送消息「。我該怎麼辦?在此先感謝 –

+0

你可以嘗試刪除'OUT_ONLY'屬性? – Bee

+0

刪除這個我可以看到結果。但它給了我一個錯誤,因爲我使用VFS,這是異步的。在發送部分,我正在將響應寫入文件。這是錯誤的:「VFS傳輸不支持同步響應,請使用適當的(只出)消息交換模式」 –

0

嘗試blocking="false"。請注意,進行此更改並不會使調用者爲asynchonus。無論阻塞是真是假,它都是同步的。阻止只是一個實現細節。

The Call mediator is used to send messages out of the ESB to an endpoint. You can invoke services either in blocking or non-blocking manner.

When you invoke a service in non-blocking mode, the underlying worker thread returns without waiting for the response. In blocking mode, the underlying worker thread gets blocked and waits for the response after sending the request to the endpoint. Call mediator in blocking mode is very much similar to the Callout mediator.

In both blocking and non-blocking modes, Call mediator behaves in a synchronous manner. Hence, mediation pauses after the service invocation and resumes from the next mediator in the sequence when the response is received. Call mediator allows you to create your configuration independent from the underlying architecture.

https://docs.wso2.com/display/ESB500/Call+Mediator

+0

我改阻塞=「假」,但沒有改變... –

+0

使電線日誌,看看。 http://lakshanigamage.blogspot.com/2015/03/how-to-enable-wire-logs-in-wso2-esbapim.html – Bee

+0

@ Bhathiya非常感謝你。現在我可以在控制檯中看到所需的輸出。但爲什麼在正常情況下我看不到結果?我怎樣才能保存這個結果? –