Wso2 我们可以在代理序列中获得类返回属性吗

Wso2 我们可以在代理序列中获得类返回属性吗,wso2,wso2esb,wso2dss,Wso2,Wso2esb,Wso2dss,我编写了自定义中介程序,它工作得很好。我正在使用类似这样的插入顺序将值传递给我的类中介程序 <?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

我编写了自定义中介程序,它工作得很好。我正在使用类似这样的插入顺序将值传递给我的类中介程序

<?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="FORCE_ERROR_ON_SOAP_FAULT" value="true"/>
         <property name="Reading"
                   expression="//Readings"
                   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="userid"
                   expression="//userid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="assetid"
                   expression="//assetid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="partybranchid"
                   expression="//partybranchid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="activityid"
                   expression="//activityid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="clientid"
                   expression="//clientid/text()"
                   scope="default"
                   type="STRING"/>
         <property name="ouid"
                   expression="//ouid/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')"/>
            <property name="partybranchid" expression="get-property('partybranchid')"/>
         </log>
         <iterate continueParent="true"
                  id="Readings"
                  expression="//ReadingsLiteTaildto">
            <target>
               <sequence>
                  <property name="actiondetailid" expression="get-property('actiondetailid')"/>
                  <property name="parameterid" expression="//ParameterId/text()"/>
                  <property name="slno" expression="//SlNo/text()"/>
                  <property name="inputvalue" expression="//InputValue/text()"/>
                  <property name="inputtext" expression="//InputText/text()"/>
                  <property name="finalvalue" expression="//FinalValue/text()"/>
                  <payloadFactory>
                     <format>
                        <p:insert_treadings_operation xmlns:p="http://ws.wso2.org/dataservice">
                           <xs:actiondetailid xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:actiondetailid>
                           <xs:slno xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:slno>
                           <xs:parameterid xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:parameterid>
                           <xs:inputvalue xmlns:xs="http://ws.wso2.org/dataservice">$4</xs:inputvalue>
                           <xs:inputtext xmlns:xs="http://ws.wso2.org/dataservice">$5</xs:inputtext>
                           <xs:finalvalue xmlns:xs="http://ws.wso2.org/dataservice">$6</xs:finalvalue>
                        </p:insert_treadings_operation>
                     </format>
                     <args>
                        <arg expression="get-property('actiondetailid')"/>
                        <arg expression="get-property('slno')"/>
                        <arg expression="get-property('parameterid')"/>
                        <arg expression="get-property('inputvalue')"/>
                        <arg expression="get-property('inputtext')"/>
                        <arg expression="get-property('finalvalue')"/>
                     </args>
                  </payloadFactory>
                  <send receive="tReadingsid_Seq">
                     <endpoint>
                        <address uri="http://localhost:9764/services/treadings_DataService/"
                                 format="soap11"/>
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </iterate>
        <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
<property xmlns:ns="http://org.apache.synapse/xsd"
             name="Time"
             expression="get-property('SYSTEM_TIME')"
             scope="default"
             type="STRING"/>
         <property name="actiondetailid"
                   expression="get-property('actiondetailid')"
                   scope="default"
                   type="STRING"/>
         <property name="OUT_ONLY" value="true"/>
         <property name="dbconnectionurl"
                   value="jdbc:postgresql://$$$$$$$$$$/*****"/>
         <property name="dbuser" value="##########"/>
         <property name="dbpassword" value="*******"/>
         <class name="in.youtility.esb.custommediators.ReadingAlertMediator"/>
<property name="Message"
                   expression="get-property('Message')"
                   scope="default"
                   type="STRING"/>
      </inSequence>
      <outSequence onError="fault"/>
   </target>
</proxy>

$1
$2
$3
$4
$5
$6
消息属性在类内定义 所以我希望从外部类中检索它意味着不连续
在wso2esb中是否可能?如果我从类中获取此属性,那么我将获得场景

是。这是可能的。它将作为一个普通属性工作,在从类中介器获得返回值后,您可以在任何地方引用它。 如前所述,您可以获取属性“Message”,但在此之前,您需要将结果分配给属性“Message”

请参见以下分配结果的示例

        <class name="in.youtility.esb.custommediators.ReadingAlertMediator">
                        <property name="target" value="Message"/>
        </class>


根据您关于将输入参数传递给类的说法,这意味着什么,但我正在考虑结果如果我没有错,您希望说我们需要将默认值分配给属性,就像您在类中介中分配的message=10一样,它可能会在运行时更改..抱歉,我错误地混淆了,我将编辑如何得到结果的答案。