1

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

<?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>

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

<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 中定义动态邮件,我们需要再次使用其他方式,请告诉我

4

1 回答 1

0

您可以参考 [1] 中的 Proxy 配置,它在从数据库中检索到电子邮件地址后发送电子邮件。

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

于 2013-07-16T04:32:28.120 回答