Hi there,
i’ve two Servoy solutions:
Solution A:
Provides a Webservice with the Servoy RESTful Web Services Plugin with the following settings:
rest_ws_plugin_client_pool_exhausted_action: grow
rest_ws_plugin_authorized_groups: Webservice
rest_ws_plugin_client_pool_size: 1
In the group Webservice is one user called “webservice”.
Solution B:
Wants to call the Webservice with a CREATE request with the following code:
var poster = plugins.http.getPoster('http://192.168.1.2:8080/servoy-service/rest_ws/servoy_sample_rest_ws/ws_employees');
poster.addHeader('Content-type','text/xml; charset=UTF-8')
poster.setCharset('UTF-8');
var xml = createWebserviceXml();
var jsFile = plugins.file.createTempFile('data','.xml');
plugins.file.writeXMLFile(jsFile , xml);
poster.addFile(null, 'data.xml', jsFile.getAbsolutePath());
var httpCode = poster.doPost('webservice', 'password'); //httpCode 200 is ok
When i deactivate webservice authentification (change settings on solution A and just call poster.doPost()) everything works fine and i get the request in the ws_create() method of solution A.
But when i use authentification, i get the httpCode = 0 and the following error log in servoy-admin/logs from solution A:
2012-05-03 11:22 http-8084-1 ERROR com.servoy.extensions.plugins.rest_ws.RestWSPlugin /servoy-service/rest_ws/servoy_sample_rest_ws/ws_employees
I/O exception, see log for full details: Invalid chunk header
The XML from method createWebserviceXml() looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<company>A Company</company>
<name>My Name</name>
<firstname>My first name</firstname>
<email>email@email.de</email>
<phone>123</phone>
<street>My street</street>
<city>My City</city>
<zipcode>12345</zipcode>
<nation>Germany</nation>
<housenumber>4711</housenumber>
<customer_id>4712</customer_id>
<uuid_webformulare>2A5EF776-D042-4402-A57C-17F88978A7D8</uuid_webformulare>
I’ve also tried to make the XML easier like this:
<?xml version="1.0" encoding="UTF-8"?>
<name>abc</name>
But it makes no difference.
Can anybody help me please?
Thanks a lot!
Alex
P.S.
We use Servoy 5.2.13 on both solutions / application servers