2013-06-24 28 views
2

我已经写在ESB代理服务读我已经存储在配置注册表文件,我代理的是:如何读取wso2 esb中的属性文件?

<?xml version="1.0" encoding="UTF-8"?> 
    <proxy xmlns="http://ws.apache.org/ns/synapse" 
      name="deleteme" 
      transports="https http" 
      startOnLoad="true" 
      trace="disable"> 
     <description/> 
     <target> 
      <inSequence> 
<property xmlns:p="http://tempuri.org/" name="SourceID" expression="//p:SourceID" scope="default" type="STRING"/> 
      <property name="test" 
         expression="get-property('registry','conf:/test.xml')" 
         scope="default" 
         type="OM"/> 
      <property name="test.AddressEP" expression="$ctx:test//AddressEP"/> 
      <log level="custom"> 
       <property name="test.AddressEP" expression="$ctx:test//AddressEP"/> 
      </log> 
      <header name="To" expression="get-property('test.AddressEP')"/> 
      <send/> 
      </inSequence> 
     </target> 
     <publishWSDL uri="http://pc241059:8281/services/echo?wsdl"/> 
    </proxy> 

现在不是在物业提供的硬编码数据AddressEP ​​

<property name="test.AddressEP" expression="$ctx:test//AddressEP"/> 

我要传递的属性值:

<property xmlns:p="http://tempuri.org/" name="SourceID" expression="//p:SourceID"/> 

<property name="test.AddressEP" expression="$ctx:test//get-property('SourceID')"/> 

但是我无法做到这一点,请帮助我。期待你的回答。这与树模型的工作,如选择节点等在此先感谢

+0

你还在寻找答案吗? –

回答

0

我不认为这是正确的[1]当您使用路径导航,你需要使用,功能..(虽然我不确定)

在你的情况,你可以简单地使用XPath字符串合并功能..

[1] <property name="test.AddressEP" expression="$ctx:test//get-property('SourceID')"/>

0

我觉得this可以解决你的问题。 它显示如何从注册表中的xml文件读取。