我们可以在 wso2esb 中以相同的顺序发送多个邮件还是动态设置一个邮件 [英] Can we send Multiple Mail in wso2esb in same sequence or dynamically set a mail

查看:13
本文介绍了我们可以在 wso2esb 中以相同的顺序发送多个邮件还是动态设置一个邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从前端获取数据,我需要验证跨数据库的数据.如果是最小值或最大值,当前值介于最小值和最大值之间将来针对数据库,如果定义静态可能会发生变化.所以我该怎么做,我的代理是

i am getting data from front end i need to verify the data across database. present value is between the min value and max if it is min or max i need to send a mail to concern person which has been defined in database,in that case i don,t know what is the mail id of client i need cross check against database in future it might be change if define static.so how can i do this my proxy is

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="tReadingMobile_5"
       transports="https http"
       startOnLoad="true"
       trace="disable">
   <description/>
   <target>
      <inSequence onError="fault">

         <property name="partybranchid"
                   expression="//partybranchid"
                   scope="default"
                   type="STRING"/>
         <property name="Reading"
                   expression="//ReadingsLiteTaildto"
                   scope="default"
                   type="STRING"/>
         <property name="actiondetailid"
                   expression="//actiondetailid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="actionid"
                   expression="//actionid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="assetid"
                   expression="//assetid/text()"
                   scope="default"
                   type="STRING"/>
         <log level="custom">
            <property name="fff" expression="get-property('Reading')"/>
            <property name="ggggg" expression="get-property('actiondetailid')"/>
            <property name="hhhh" expression="get-property('actionid')"/>
         </log>
         <iterate id="Min_Max" expression="//ReadingsLiteTaildto">
            <target>
               <sequence>
                  <property name="FinalValue" expression="//FinalValue/text()"/>
                  <property name="assetid" expression="get-property('assetid')"/>
                  <property name="parameterid" expression="//ParameterId/text()"/>
                  <payloadFactory>
                     <format>
                        <p:select_Min_Max_Op xmlns:p="http://ws.wso2.org/dataservice">
                           <xs:assetid xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:assetid>
                           <xs:parameterid xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:parameterid>
                        </p:select_Min_Max_Op>
                     </format>
                     <args>
                        <arg expression="get-property('assetid')"/>
                        <arg expression="get-property('parameterid')"/>
                     </args>
                  </payloadFactory>
                  <log level="full"/>
                  <send receive="ReadingsAlertUpdate_Seq">
                     <endpoint>
                        <address uri="http://localhost:9764/services/massetparametersetdetail_DataService/"
                                 format="soap11"/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </iterate>
      </inSequence>
      <outSequence onError="fault"/>
   </target>
</proxy>  

而我的顺序是这样的

<?xml version="1.0" encoding="UTF-8"?>
<sequence xmlns="http://ws.apache.org/ns/synapse"
          name="ReadingsAlertUpdate_Seq"
          onError="fault">
   <property name="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             name="actiondetailid"
             expression="get-property('actiondetailid')"/>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             xmlns:x="http://ws.wso2.org/dataservice"
             name="maxvalue"
             expression="//x:maxvalue/text()"
             scope="default"
             type="STRING"/>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             xmlns:x="http://ws.wso2.org/dataservice"
             name="minvalue"
             expression="//x:minvalue/text()"
             scope="default"
             type="STRING"/>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             xmlns:x="http://ws.wso2.org/dataservice"
             name="iscritical"
             expression="//x:iscritical/text()"
             scope="default"
             type="STRING"/>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             name="FinalValue"
             expression="get-property('FinalValue')"
             scope="default"
             type="STRING"/>
<filter xmlns:ns="http://org.apache.synapse/xsd"
           xpath="get-property('FinalValue') &lt; get-property('minvalue')">
      <then>
         <property name="Message1" value="1" scope="default" type="STRING"/>
      </then>
      <else>
         <filter xpath="get-property('FinalValue') &gt; get-property('maxvalue')">
            <then>
               <property name="Message1" value="1" scope="default" type="STRING"/>
            </then>
            <else>
               <property name="Message0" value="0" scope="default" type="STRING"/>
            </else>
         </filter>
      </else>
   </filter>
   <property xmlns:ns="http://org.apache.synapse/xsd"
             name="Message1"
             expression="get-property('Message1')"
             scope="default"
             type="STRING"/>
   <property name="Mesage0"
             expression="get-property('Message0')"
             scope="default"
             type="STRING"/>
   <filter xmlns:ns="http://org.apache.synapse/xsd"
           xpath="get-property('Message1')=1=get-property('iscritical')">
      <then>
<payloadfactory>
<format>
 <p:GetUserMail_Op xmlns:p="http://ws.wso2.org/dataservice">
           <xs:partybranchid xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:partybranchid>
   </p:GetUserMail_Op>
</format>
<args>
  <arg expression="get-property('partybranchid')"/>
</args>
<send receive="ReadingsAlertUpdate_Seq2">
                     <endpoint>
                        <address uri="http://localhost:9764/services/taciondetailmail_DataService/"
                                 format="soap11"/>
                     </endpoint>
                  </send>
      <else>
<property name="Alert2" value="Nothing has been Updated"/>
</else>
   </filter>
</sequence>

我正在按此顺序接收邮件,那么如何在端点中定义此邮件

and i am reciving mail in this sequence so how can i define this mail in endpoint

<sequence xmlns="http://ws.apache.org/ns/synapse"
          name="ReadingsAlertUpdate_Seq2"
          onError="fault">
  <property xmlns:ns="http://org.apache.synapse/xsd"
                xmlns:v="http://ws.wso2.org/dataservice"
                name="Mail"
                expression="//v:Mail/text()"/>
<log level="full"/>
         <property name="OUT_ONLY" value="true" scope="default" type="STRING"/>
         <property name="Subject"
                   value="Alert Genrated"
                   scope="transport"
                   type="STRING"/>
         <property name="messageType"
                   value="text/html"
                   scope="axis2"
                   type="STRING"/>
         <property name="ContentType"
                   value="text/html"
                   scope="axis2"
                   type="STRING"/>
         <send>
            <endpoint>
               <address uri="$Mail"/>
            </endpoint>
         </send>

</sequence>

是否可以在 wso2esb r 中定义动态邮件,我们需要再次使用其他方式,请告诉我

Is it possible to define dynamic mail in wso2esb r we need again use some other way please ..let me know

推荐答案

可以参考[1]中的Proxy配置,从数据库中获取邮箱地址后发送邮件.

You can refer Proxy configuration in [1], which sends an email after retrieveing the email address from the database.

[1]http://wso2.com/library/articles/2012/01/integrating-different-systems-with-wso2-esb

这篇关于我们可以在 wso2esb 中以相同的顺序发送多个邮件还是动态设置一个邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆