-->

我们可以设置使用XPath表达式发送调停(Can we Set a Send mediator wi

2019-09-26 11:19发布

我试图将消息发送给我的电子邮件,我使用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>

如果需要任何修改请让我知道

Answer 1:

如果你想从一个属性值的电子邮件地址,然后用头中介设置的“到”“电子邮件地址:faisal.shaik@youtility.in”值。

你可以发送调停之前添加以下

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


Answer 2:

您可以使用此:

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


Answer 3:

   <send>
             <address uri="mailto:xxx@yyy"/>
         </send>

键表达式也可以使用..



文章来源: Can we Set a Send mediator with Xpath expression