Thanks Stepan, that got me in the right direction.
That is to say, I can use a 'template' now, and values inside the tempate are replaced, but I get some errors. I think these are not related to the EL syntax, but apperently to the file content (in relation to the bodyPart/RawFileBodyPart I use). This file however is used before by the previous implementation (formUpload) without errors.
Is my combination of bodyPart - RawFileBodyPart - ElFileBody correct?
The new version of my code:
def importXML(size: String, merge: Boolean) = exec(http("Import merge" + merge.toString + ": /rapportage/ABC-M.2016-02.{userId}.e.xml?merge=" + merge.toString + " " + size)
.post("/ebridge/api/rapportage/ABC-M.2016-02.${userId}.e.xml?merge=" + merge.toString)
.headers(headers_import)
.bodyPart(RawFileBodyPart("file", ElFileBody("rap-ABC-M-2016-2.10k.xml")))
//.formUpload("file", "rap-ABC-M-2016-2.${userId}." + size + ".xml")
).pause(Durations.lowPause, Durations.highPause)
The (first line) of my template (rap-ABC-M-2016-2.10k.xml):
<?xml version="1.0" encoding="ISO-8859-1"?><?bestandsnaam ABC-M.2016-02.${userId}.e.xml?><?eerstemaandrapportageperiode 2016-02?> etc. etc.
The error I got:
---- Errors --------------------------------------------------------------------
> Failed to build request Import mergefalse: /rapportage/ABC-M.2 2 (Infinity%)
016-02.{userId}.e.xml?merge=false 10k: Failed to build request...
================================================================================
12:07:44.295 [ERROR] i.g.h.a.s.HttpRequestAction - 'httpRequest-11' failed to execute: Failed to build request: Illegal char <<> at index 0: <?xml version="1.0" encoding="ISO-8859-1"?><?bestandsnaam ABC-M.2016-02.12000001.e.xml?><?eerstemaandrapportageperiode 2016-02?><?first false?><?laatstemaandrapportageperiode 2016-02?><?nihil false?><?rapportageperiode 2016-02?><?registratienummer 12000001?><?status e?><?versienr 1?>
etc. etc.
Any ideas what could cause this?
Op woensdag 24 augustus 2016 17:16:39 UTC+2 schreef Stéphane Landelle: