【问题标题】:Can we Set a Send mediator with Xpath expression我们可以使用 Xpath 表达式设置发送中介吗
【发布时间】:2015-10-11 03:41:27
【问题描述】:

我正在尝试向我的电子邮件发送一条消息,因为我正在使用发送调解器以及我在 AXIS2 文件中设置所需的配置

是否适用于以下代理 如果不是,那么给 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:faisal.shaik@youtility.in" scope="default" type="STRING"/>
         <log level="full">
            <property name="Mail" value="mailto:faisal.shaik@youtility.in"/>
         </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>

如果需要任何更改,请告诉我

【问题讨论】:

    标签: wso2 wso2esb wso2dss


    【解决方案1】:

    如果您想从属性值中获取电子邮件地址,则使用标头中介将“To”的值设置为“mailto:faisal.shaik@youtility.in”。

    您可以在发送中介之前添加以下内容

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

    【讨论】:

      【解决方案2】:

      你可以用这个:

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

      【讨论】:

        【解决方案3】:
           <send>
                     <address uri="mailto:xxx@yyy"/>
                 </send>
        

        key-expression 也可以用..

        【讨论】:

        • 我知道它有这个选项..但是我的场景是发送不需要是静态的,它应该是一个动态的邮件ID,每次都会根据客户端数据库更改请参考@987654321 @和stackoverflow.com/questions/17420179/…
        • 我们如何使用发送键表达式。我找不到合适的文档。这是什么类型的工具。
        猜你喜欢
        • 2015-03-08
        • 2010-09-29
        • 2021-12-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多