My WSO2 ESB Proxy Service receives the following request:
<ReadFormRequest>
<formID>1470</formID>
<name>ConstructionForm</name>
</ReadFormRequest>
I need to change ReadFormRequest to GetFormRequest and send it to the endpoint.
Here is my PayloadFactory code that is supposed to do the job:
<payloadFactory media-type="xml">
<format>
<GetFormRequest>
$1
</GetFormRequest>
</format>
<args>
<arg evaluator="xml" expression="$body/ReadFormRequest/*"/>
</args>
</payloadFactory>
The problem is that my XPath expression "$body/ReadFormRequest/*" returns values of the child elements instead of the actual elements. Thus I am getting the following result:
<GetFormRequest>
1470ConstructionForm
</GetFormRequest>
According to XPath documentation this query should return the elements, but it seems like WSO2 retrieves element values instead.