Hi all,
<br><br>I would like to connect to drools-server with HTTPClient with the following
<br>config:
<br><br><pre><beans xmlns="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a>"<br> xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xmlns:drools="<a href="http://drools.org/schema/drools-spring">http://drools.org/schema/drools-spring</a>"<br> xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</a><br>
<a href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a><br> <a href="http://drools.org/schema/drools-spring">http://drools.org/schema/drools-spring</a><br>
<a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd</a>"><drools:execution-node id="node1" />&nbsp; &nbsp; &nbsp; &nbsp; <drools:kbase id="kbase1" node="node1"/>&nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; <drools:kagent id="kagent1" kbase="kbase1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <drools:resources>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <drools:resource type="CHANGE_SET" source="classpath:changeset.xml" />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </drools:resources>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
&nbsp; &nbsp; &nbsp; &nbsp; </drools:kagent>&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; <drools:ksession id="ksession1" type="stateless" kbase="kbase1" node="node1"/>&nbsp; &nbsp; &nbsp; &nbsp; <br>
</beans></pre><br>where my changeset.xml is adding a snapshot deployed with Guvnor.
<br><br>But I am not able to trig the rule with the following client:
<br><br>BatchExecutionCommandImpl command = new BatchExecutionCommandImpl();
<br>command.setLookup("ksession1");
<br>InsertObjectCommand insertObjectCommand = new InsertObjectCommand("TEST");
<br>FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
<br>command.getCommands().add(insertObjectCommand);
<br>command.getCommands().add(fireAllRulesCommand);
<br><br>String xml = BatchExecutionHelper.newXStreamMarshaller().toXML(command);
<br><br>HttpClient httpClient = new HttpClient();
<br>httpClient.getHostConfiguration().setHost("host", 8080);
<br><br>PostMethod postMethod = new
<br>PostMethod("/drools-5.1.1-server/kservice/rest/execute");
<br>postMethod.setRequestEntity(new StringRequestEntity(xml, null, null));
<br><br><br>try {
<br><br> httpClient.executeMethod(postMethod);
<br> int code = postMethod.getStatusCode();
<br> System.out.println(code);
<br> String rep = postMethod.getResponseBodyAsString();
<br> System.out.println(rep);
<br><br>} catch(Exception e) {...}
<br><br>Do someone have any idea how to achieve this?
<br><br>Thanks
<br><br>Sebastien