Hide Forgot
Description of problem: Throwing an error when calling Rest API to execute rules Version-Release number of selected component (if applicable): JBoss BRMS 6.2 How reproducible: Steps to Reproduce: 1. Follow steps in https://github.com/jbossdemocentral/brms-loan-realtime-decision-server-demo 2. Fails at Step 18 3. Actual results: JBWEB000125: The specified HTTP method is not allowed for the requested resource. Expected results: Results from Rules execution Additional info:
Due to limitations in some of the JEE containers, we had to change the POST URI for version 6.2. The linked example is outdated. The correct URI for the POST in step 18 is: http://localhost:8080/kie-server/services/rest/server/containers/instances/container-loan1.0 Instead of: http://localhost:8080/kie-server/services/rest/server/containers/container-loan1.0 Documentation also needs to be updated. Eric, can I ask you please to do a quick update on the example? I will update the kie docs.
I was just told that X-KIE-ContentType HTTP header [1] needs to be set as well for the rest calls to work. Can this be incorporated into the documentation too if it is required. [1] https://access.redhat.com/solutions/2129781
(In reply to Edson Tirelli from comment #2) > Due to limitations in some of the JEE containers, we had to change the POST > URI for version 6.2. The linked example is outdated. > > The correct URI for the POST in step 18 is: > > http://localhost:8080/kie-server/services/rest/server/containers/instances/ > container-loan1.0 > > Instead of: > > http://localhost:8080/kie-server/services/rest/server/containers/container- > loan1.0 > > Documentation also needs to be updated. > > Eric, can I ask you please to do a quick update on the example? I will > update the kie docs. > that fix is already in the project... Readme shows this new url already?
Eric, ReadMe still shows POST url in Step 18 without the context "instances". Edson, I tried with the new url you mentioned on 6.2 and I am getting empty response back following the steps in the same example: <response type="SUCCESS" msg="Container DevServer successfully called."> <results> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <execution-results> <results> <item key="applicant"/> <item key="loan"/> </results> <facts> <item key="applicant"/> <item key="loan"/> </facts> </execution-results> </results> </response> I am using this input: <batch-execution> <insert out-identifier="applicant"> <com.redhat.loandemo.Applicant> <name>Eric D. Schabell</name> <creditScore>530</creditScore> </com.redhat.loandemo.Applicant> </insert> <insert out-identifier="loan"> <com.redhat.loandemo.Loan> <amount>4500</amount> <duration>24</duration> <interestRate>1.5</interestRate> </com.redhat.loandemo.Loan> </insert> <fire-all-rules /> </batch-execution> However for the same rules server on BRMS 6.1, it just works fine with this response: <response type="SUCCESS" msg="Container container-loan1.0 successfully called."> <results> <execution-results> <result identifier="applicant"> <com.redhat.loandemo.Applicant> <name>Eric D. Schabell</name> <creditScore>530</creditScore> </com.redhat.loandemo.Applicant> </result> <result identifier="loan"> <com.redhat.loandemo.Loan> <amount>4500</amount> <duration>24</duration> <interestRate>1.5</interestRate> <approved>true</approved> </com.redhat.loandemo.Loan> </result> <fact-handle identifier="applicant" external-form="0:1:1061539597:1061539597:1:DEFAULT:NON_TRAIT"/> <fact-handle identifier="loan" external-form="0:2:475324772:475324772:2:DEFAULT:NON_TRAIT"/> </execution-results> </results> </response>
(In reply to Sudheer from comment #5) > Eric, ReadMe still shows POST url in Step 18 without the context "instances". > Fixed for sure now in master and part of v1.2 tag of the demo project.
Cool, I see the updated Post URL now. Thanks Eric. I also had to use customer header "X-KIE-ContentType: xstream" to get it working for BRMS 6.2. @Eric, I sent you a PR for your git example. This issue can be closed now.
Thank you guys. Yes, the X-KIE-ContentType header is mandatory for content type application/xml.