I have problems trying to generate a report using a "XML Document" Data adapter (remote) that uses some external parameters as input data.
I have defined the external parameters "NAME" and "AGE" but when I try to add them to the POST message body (free text) with "$P{NAME}" and "$P{AGE}" it doesn't replace the placeholders with the actual values of the parameters.
This is the XML Source of the "XML Document" data adapter:
<?xml version="1.0" encoding="UTF-8" ?> <xmlDataAdapter class="net.sf.jasperreports.data.xml.XmlDataAdapterImpl"><name>xml</name><dataFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="httpDataLocation"><method>POST</method><url>http://myendpoint.com/myendpoint.php</url><username></username><password></password><body><?xml version='1.0' standalone='yes'?> <contact> <name>$P{NAME}</name> <age>$P{AGE}</age> </contact></body><header><name>Content-Type</name><value>text/xml</value></header></dataFile><useConnection>true</useConnection><namespaceAware>false</namespaceAware><selectExpression></selectExpression><locale xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://java.sun.com" xsi:type="java:java.lang.String">es_ES</locale><timeZone xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://java.sun.com" xsi:type="java:java.lang.String">Europe/Paris</timeZone></xmlDataAdapter>
Exactly the same WORKS if I use the WebService Data Adapter plugin but doesn't work with the native "XML Document" Data Adapter.
What am I doing wrong?
I've edited the initial sample to use a more simple syntax