Is there a way, inside the javascript code from WSO2 ESB's Script mediator, to get a property's value when this property has a scope different from "default" ?
In case of a property with default scope :
get-property('MyProperty')
OR
<script language="js">
mc.getProperty("MyProperty");
</script>
In case of a property with 'transport' scope :
get-property('transport','FILE_NAME')
OR
<script language="js">
mc.????????
</script>
It seems that you can not get properties of other scopes than synapse using
mc.get-property("Property Name")
since mc is instance of Synapse.MessageContext in order to get other message context properties I do something like this in java, I don't know that if it is applicable in javascript or not. I do this for axis2 message context properties. Here "context" is the instance of Synapse.MessageContext.
org.apache.axis2.context.MessageContext axis2MessageContext;
axis2MessageContext = ((Axis2MessageContext)context).getAxis2MessageContext();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With