2013-07-03 22 views
1

我試圖將消息發送給我的電子郵件,我使用發送中介以及我安裝所需的配置Axis2中文件我們可以設置使用XPath表達式發送中介

是它的工作如下代理 如果也不是什麼給XPath來發送中介

<proxy xmlns="http://ws.apache.org/ns/synapse" name="mailCheck" transports="http" statistics="disable" trace="disable" startOnLoad="true"> 
    <target> 
     <inSequence> 
     <property name="Subject" value="Alert Message From WSO2 ESB - Service Down !!!" scope="transport" type="STRING"/> 
     <property name="messageType" value="text/html" scope="axis2" type="STRING"/> 
     <property name="ContentType" value="text/html" scope="axis2" type="STRING"/> 
     <property name="Mail" value="mailto:[email protected]" scope="default" type="STRING"/> 
     <log level="full"> 
      <property name="Mail" value="mailto:[email protected]"/> 
     </log> 
     <property name="OUT_ONLY" value="true" scope="default" type="STRING"/> 
     <send> 
      <endpoint key-expression="get-property('Mail')"/> 
     </send> 
     </inSequence> 
     <outSequence/> 
    </target> 
    <description></description> 
</proxy> 

的方式,如果需要任何修改請讓我知道

回答

0
<send> 
      <address uri="mailto:[email protected]"/> 
     </send> 

鍵表達也可以用..

+0

我知道它有選項與..但我的方案是發送不必是一個靜態的,它應該是一個動態的郵件ID會根據客戶端數據庫每次都會改變請參考這個http://stackoverflow.com/questions/17441849/is-it-possible-with-wso2esb-to-send-e -mail-using-header and http://stackoverflow.com/questions/17420179/can-we-send-multiple-mail-in-wso2esb-in-same-sequence-or-dy namically-set-a-mail –

+0

我們如何使用密鑰表達來發送。我無法找到適當的文檔這個..什麼類型的工具這.. –

1

如果您想從屬性值中獲取電子郵件地址,請使用標頭介體將「To」的值設置爲「mailto:[email protected]」。

你可以這樣做,加入發送調停之前以下

<header name="To" expression="fn:concat('mailto:', get-property('Mail'))"/> 
1

您可以使用此:

<property name="To" expression="get-property('uri.var.to')" scope="transport"/> 
<send> 
    <endpoint> 
     <address uri="mailto:"/> 
    </endpoint> 
</send> 
相關問題