Hi all,
I would like to connect to drools-server with HTTPClient with the following
config:
where my changeset.xml is adding a snapshot deployed with Guvnor.
But I am not able to trig the rule with the following client:
BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();
command.setLookup("ksession1");
InsertObjectCommand insertObjectCommand = new InsertObjectCommand("TEST");
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
command.getCommands().add(insertObjectCommand);
command.getCommands().add(fireAllRulesCommand);
String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);
HttpClient httpClient = new HttpClient();
httpClient.getHostConfiguration().setHost("host", 8080);
PostMethod postMethod = new
PostMethod("/drools-5.1.1-server/kservice/rest/execute");
postMethod.setRequestEntity(new StringRequestEntity(xml, null, null));
try {
httpClient.executeMethod(postMethod);
int code = postMethod.getStatusCode();
System.out.println(code);
String rep = postMethod.getResponseBodyAsString();
System.out.println(rep);
} catch(Exception e) {...}
Do someone have any idea how to achieve this?
Thanks
Sebastien
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-server-link-to...
Sent from the Drools - User mailing list archive at
Nabble.com.