任何人都可以解释以下 wso2 esb synapse.xml 文件的语法和功能。消息调解发生

can anyone explain the syntax and function of below wso2 esb synapse.xml file. The the message mediation coccurs

任何人都可以解释消息中介是如何在下面的 XML 代码中发生的吗?比如主序是什么,proxy service in-sequence 是什么,head mediator 在这里做什么等等。为什么在某些情况下 endpoint 在代理服务中定义上面的 in-sequence?

代理服务的参数是什么,如何使用developer studio调用序列?

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
<registry provider="org.wso2.carbon.mediation.registry.ESBRegistry">
<parameter name="localRegistry">/</parameter>
<parameter name="cachableDuration">15000</parameter>
</registry>
<proxy name="CreditCardPaymentService"
      transports="https http"
      startOnLoad="true"
      trace="disable">
  <description/>
  <target>
     <inSequence>
        <property xmlns:xsd="http://ccps.services.esb.wso2.packt.com/xsd"
                  xmlns:m0="http://ccps.services.esb.wso2.packt.com"
                  name="symbol"
                  expression="//m0:doPayment/m0:paymentInfo/xsd:cardType"
                  scope="default"
                  type="STRING"/>
        <property xmlns:xsd="http://ccps.services.esb.wso2.packt.com/xsd"
                  xmlns:m0="http://ccps.services.esb.wso2.packt.com"
                  name="filepath"
                  expression="fn:concat('file:./repository/', //m0:doPayment/m0:paymentInfo/xsd:cardType)"/>
        <property name="EPR"
                  expression="get-property('registry',$ctx:filepath)"
                  type="STRING"
                  pattern="&lt;value&gt;(.+?)&lt;/value&gt;"
                  group="1"/>
        <header name="To" expression="get-property('EPR')"/>
        <sequence key="{$ctx:symbol}"/>
        <send/>
     </inSequence>
     <outSequence>
        <send/>
     </outSequence>
  </target>
  <publishWSDL>
     ...............................
  </publishWSDL>
</proxy>
<sequence name="VISA">
    <payloadFactory>
        <format>
            .....
        </format>
        <args>
            .....
        </args>
    </payloadFactory>
    </sequence>
    <sequence name="fault">
    <log level="full">
        <property name="MESSAGE" value="Executing default 'fault' sequence"/>
        <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
        <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
    </log>
    <drop/>
    </sequence>
    <sequence name="AMEX">
    <payloadFactory>
        <format>
            .....
        </format>
        <args>
            ......
        </args>
    </payloadFactory>
    </sequence>
    <sequence name="main">
    <in>
        <log level="full"/>
        <filter source="get-property('To')" regex="http://localhost:9000.*">
        <send/>
        </filter>
    </in>
    <out>
        <send/>
    </out>
    <description>The main sequence for the message mediation</description>
    </sequence>
    </definitions>

如果有人调用您的 CreditCardPaymentService 代理服务代理内的消息流命中了 inSequence,则:

  1. 在符号 属性 中,您获得 xpath 的值 = //m0:doPayment/m0:paymentInfo/xsd:cardType 结果应用于传入消息。
  2. 在文件路径 属性 中,您将得到字符串 "file:./repository/" 与 //m0:doPayment/m0:[=49= 的 xpath 结果的连接结果]:卡片类型

  3. 在 EPR 属性 中,您获取文件路径的内容值,在 ESB 或 EI 内部注册表中。

  4. To header 设置为 ERP 值。

  5. 您使用符号 属性 值调用动态序列。例如,如果符号值等于 "A",您调用名称等于 "A" 在此代理中,您有一个 VISA 序列和一个 AMEX 序列。

  6. 两个序列都使用 payloadfactory 中介创建新的有效负载消息。

  7. 调用正确的序列后,发送中介将消息发送到 header "To" 值目的地。

  8. 响应消息到达 outSequence 并将其发送到代理客户端。