A little, big problem (as usual).
I need to convert images from one format to a different one using an online service (https://www.online-convert.com/, there are many others but this seems to be the most professional). Before trying to access the conversion application I need to know which server to use for server load balancing reasons. According to their website I have to make a XML request as follows:
<?xml version="1.0" encoding="utf-8"?>
<queue>
<apiKey>2e3152........03258494237510e6</apiKey>
<targetType>image</targetType>
</queue>
and the answer should look like this
<?xml version="1.0" encoding="utf-8"?>
<queue-answer>
<status>
200
<message>Found free slot on server.</message>
</status>
<params>
<server>http://www18.online-convert.com</server>
</params>
</queue-answer>
To use this service from Servoy I have written this simple method
var xmlfile = "<?xml version='1.0' encoding='utf-8'?><queue><apiKey>8703ce0ed6dfb9c06nhybe5f65c841f1</apiKey><targetType>image</targetType></queue>";
var client = plugins.http.createNewHttpClient();
var poster = client.createPostRequest('http://api.online-convert.com/get-queue');
var head = poster.addHeader('Content-type', 'multipart/form-data');
poster.addParameter('queue',xmlfile);
var response = poster.executeRequest();
var httpBody = response.getResponseBody();
But I always receive an error message saying
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<queue-answer>
<status>
8
<message>The XML file is empty. Please verify that you have send us a variable \"queue\" filled with the XML data.</message>
</status>
</queue-answer>
Any idea on where I am wrong? Thanks.