【问题标题】:WSO2ESB- The 'name' attribute is required for a Proxy service definitionWSO2ESB - 代理服务定义需要“名称”属性
【发布时间】:2013-03-06 17:11:43
【问题描述】:

我在部署此示例时遇到问题:“使用 SOA 进行复杂事件处理和业务规则管理”(链接:http://wso2.org/library/articles/2011/07/complex-event-processing-business-rule-management-soa

我做了所有细节,但是当我将"cepSample.xml" 文件复制到"wso2esb-4.6.0/repository/deployment/server/synapse-configs/default/proxy-services" 位置时,我在控制台中收到此错误,我不会被部署: /WSO2/wso2esb-4.6.0/repository/deployment/server/synapse-configs/default/proxy-services/cepSample.xml failed - Continue in fail-safe mode org.apache.synapse.SynapseException: The 'name' attribute is required for a Proxy service definition

【问题讨论】:

    标签: wso2 soa wso2esb rule-engine complex-event-processing


    【解决方案1】:

    我尝试手动创建代理服务 - 并获取此文件(在 ESB 4.8.1 中。) 可能对你有帮助:

    <proxy xmlns="http://ws.apache.org/ns/synapse"
           name="cepSample"
           transports="https,http"
           statistics="disable"
           trace="disable"
           startOnLoad="true">
       <target>
          <inSequence>
             <log level="full"/>
             <property name="txAmount" expression="//reqFinancTx/amount/text()"/>
             <property name="financTx" expression="//reqFinancTx/financTx/text()"/>
             <dblookup>
                <connection>
                   <pool>
                      <password>esb</password>
                      <user>esb</user>
                      <url>jdbc:mysql://localhost:3306/brms_db</url>
                      <driver>com.mysql.jdbc.Driver</driver>
                   </pool>
                </connection>
                <statement>
                   <sql>
                 SELECT * FROM `BRMS_USER_INFO` where `user_id`=? </sql>
                   <parameter expression="//reqFinancTx/userID" type="VARCHAR"/>
                   <result name="balance" column="account_balance"/>
                   <result name="userId" column="user_id"/>
                   <result name="userName" column="name"/>
                   <result name="access" column="accessability"/>
                </statement>
             </dblookup>
             <log>
                <property name="userId" expression="get-property('userId')"/>
                <property name="userName" expression="get-property('userName')"/>
                <property name="access" expression="get-property('access')"/>
                <property name="balance" expression="get-property('balance')"/>
                <property name="txAmount" expression="get-property('txAmount')"/>
                <property name="financTx" expression="get-property('financTx')"/>
             </log>
             <xslt key="sampleXSLT">
                <property name="accountBalance" expression="get-property('balance')"/>
             </xslt>
             <log level="full"/>
             <property name="STATE" value="PERSON_INFO_REQUEST"/>
             <send>
                <endpoint>
                   <address uri="http://localhost:9764/services/transactionValidatorService"/>
                </endpoint>
             </send>
          </inSequence>
          <outSequence>
             <log>
                <property name="xxxxxx" expression="get-property('STATE')"/>
             </log>
             <switch source="get-property('STATE')">
                <case regex="PERSON_INFO_REQUEST">
                   <log level="full"/>
                   <property xmlns:brs="http://brs.carbon.wso2.org"
                             xmlns:ax26="http://transactionApprovalService.samples/xsd"
                             name="RESULT"
                             expression="//brs:processTransactionResponse/brs:TransactionResult/ax26:transactionCanProceed"/>
                   <log>
                      <property name="RESULT" expression="get-property('RESULT')"/>
                   </log>
                   <switch source="get-property('RESULT')">
                      <case regex="true">
                         <clone>
                            <target>
                               <sequence>
                                  <xslt key="cepXSLT">
                                     <property name="userId" expression="get-property('userId')"/>
                                     <property name="financTx" expression="get-property('financTx')"/>
                                  </xslt>
                                  <log level="full"/>
                                  <send>
                                     <endpoint>
                                        <address uri="http://localhost:9766/services/localBrokerService/AllTransactions"/>
                                     </endpoint>
                                  </send>
                               </sequence>
                            </target>
                            <target>
                               <sequence>
                                  <dblookup>
                                     <connection>
                                        <pool>
                                           <password>esb</password>
                                           <user>esb</user>
                                           <url>jdbc:mysql://localhost:3306/brms_db</url>
                                           <driver>com.mysql.jdbc.Driver</driver>
                                        </pool>
                                     </connection>
                                     <statement>
                                        <sql> SELECT * FROM `BRMS_USER_INFO` where `user_id`=? </sql>
                                        <parameter expression="//reqFinancTx/userID" type="VARCHAR"/>
                                        <result name="balance" column="account_balance"/>
                                        <result name="userId" column="user_id"/>
                                        <result name="userName" column="name"/>
                                        <result name="access" column="accessability"/>
                                     </statement>
                                  </dblookup>
                                  <log>
                                     <property name="userId" expression="get-property('userId')"/>
                                     <property name="userName" expression="get-property('userName')"/>
                                     <property name="access" expression="get-property('access')"/>
                                  </log>
                                  <switch source="get-property('access')">
                                     <case regex="false">
                                        <xslt key="accLockedXSLT"/>
                                        <send/>
                                     </case>
                                     <case regex="true">
                                        <xslt key="txProceedXSLT"/>
                                        <send/>
                                     </case>
                                  </switch>
                               </sequence>
                            </target>
                         </clone>
                      </case>
                      <case regex="false">
                         <log level="full">
                            <property name="sequence"
                                      value="outSequence - STATE 02 - response from CreditService"/>
                         </log>
                         <send/>
                      </case>
                   </switch>
                   <send>
                      <endpoint key="CreditEpr"/>
                   </send>
                </case>
                <case regex="CREDIT_REQUEST">
                   <log level="full">
                      <property name="sequence"
                                value="outSequence - STATE 02 - response from CreditService"/>
                   </log>
                   <send/>
                </case>
             </switch>
          </outSequence>
       </target>
    </proxy>
    

    【讨论】:

      猜你喜欢
      • 2013-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-06
      • 1970-01-01
      相关资源
      最近更新 更多