I am absolutly new in WSO2 and I am working on a WSO2 Enterprise Integrator project containing this ESB project section (I think that my question is only related to ESB).
So my doubt is: I have an XML file defining an API. The flow starts with a payloadFactory mediator, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<api context="/xxxTest2" name="xxxTest2" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET">
<inSequence>
<!-- Create empty message to get all samples from DSS -->
<!-- Get Sample ID -->
<payloadFactory media-type="xml">
<format>
<body/>
</format>
<args>
<arg evaluator="xml" expression="get-property('uri.var.int_val')" xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd"/>
</args>
</payloadFactory>
...............................................................
...............................................................
...............................................................
</api>
This API handle request that I can send using CURL:
curl -v http://MY_SERVER_IP:8280/xxxTest2
Reading the official documentation:
https://docs.wso2.com/display/ESB481/PayloadFactory+Mediator
I know that the payload factory is used to create a content message that have to be sent using something that send an HTTP Request (correct me if this is a wrong assertion).
My doubt is:
the content of this message is empty because it is:
<format>
<body/>
</format>
But it contains this argument defined into the args element:
<args>
<arg evaluator="xml" expression="get-property('uri.var.int_val')" xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd"/>
</args>
So I have 2 doubts:
1) Reading the previous documentation this argument should contain the content value of a $1 variable in the previous payload content (the ... element). But it is empty. It doesn't contain any variable. So why I find this argument?
2) The value of the argument is retrieved with an expression:
expression="get-property('uri.var.int_val')"
What exactly does this expression? What is retrieving?