I am currently loading data from a local entry in the wso2 esb using the following satement:
<property name="MAPPING" expression="get-property('mapping_id_ep_v1')" />
It loads the following local entry with the name mapping_id_ep_v1:
<mappings>
<mapping id="ep_1">http://localhost:8280/services/ep_1</mapping>
<mapping id="ep_2">http://localhost:8280/services/ep_2</mapping>
<mapping id="ep_3">http://localhost:8280/services/ep_3</mapping>
<mappings>
I would like to load the data from a registry entry. I thought the following would work:
However, it throws an exception:
Evaluation of the XPath expression conf:/custom/inspectieview/routing.xml') resulted in an error {org.apache.synapse.util.xpath.SynapseXPath}
org.jaxen.UnresolvableException: Cannot resolve namespace prefix 'conf'
Anyone know if it is possible to load a value from the registry into a property mediator?
Regards, nidkil
I solved my question. For anyone interested in the solution it is actually very simple. The following code loads a resource stored in the registry into a property that can be referenced in a mediator /sequence / etc.
<property name="MAPPING" expression="get-property('gov:/custom/service/resource')" />
Regards, nidkil
You can achieve your requirement using the below configuration.
<property name="testProp" expression="get-property('registry', 'gov://custom/testEntry')" scope="default" type="STRING"/>
Look at this
http://wso2.org/project/esb/java/4.0.3/docs/samples/message_mediation_samples.html
Sample 8 and following will help you
来源:https://stackoverflow.com/questions/11210545/loading-a-registry-entry-into-a-wso2-property-mediator