Over a million developers have joined DZone.

Retrieve Values From XML in Config Registry with WSO2 ESB

Is iPaaS solving the right problems? Not knowing the fundamental difference between iPaaS and dPaaS could cost you down the road. Brought to you in partnership with Liaison Technologies.

The following configuration can retrieve the values in a config registry using the WSO2 ESB.

<proxy xmlns="http://ws.apache.org/ns/synapse" name="test123" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="test" expression="get-property('registry','conf:/test.xml')" scope="default" type="OM" />
         <log level="custom">
            <property name="test.b" expression="$ctx:test//b" />
         </log>
      </inSequence>
      <outSequence>
         <send />
      </outSequence>
      <endpoint>
         <address uri="http://localhost:8280/services/Version" />
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost:8280/services/Version?wsdl" />
   <policy key="conf:/repository/axis2/service-groups/test123/services/test123/policies/61afea637b914422e1753dde4e88864cc199fecbb66084e2" />
   <policy key="conf:/repository/axis2/service-groups/test123/services/test123/policies/urn:version" />
</proxy> 


Then create an xml file in the config registry with following content.


<a>Hello<b>WSO2</b></a>


You will see the following log


[2013-02-18 23:33:35,690] INFO - LogMediator test.b = WSO2 

Discover the unprecedented possibilities and challenges, created by today’s fast paced data climate and why your current integration solution is not enough, brought to you in partnership with Liaison Technologies.

Topics:
java ,enterprise-integration ,xml ,integration ,tips and tricks ,wso2 esb

Published at DZone with permission of Achala Chathuranga Aponso, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}