...
Deploying and Testing the Service
1. Deploy the rule service through the BRS management console. You can follow either of the two methods:
- Bundle all artifacts in an .aar file and upload it (Rule Service -> Upload menu).
- Create using the Rule Service wizard UI (Rule Service -> Create menu).
The above steps are discussed in detail in Exposing Rules as Services.
2. After deployment, the service will appear in the Deployed Services window of the BRS management console. Access the service's dashboard by clicking on it.
3. In the Client Operations
widget of the dashboard, invoke the Try-it toolTesting WSDLs (Try-it Tool) to to test the service.
4. In the service's Try-it window, issue a request similar to the following. First add a product before buying it.
Adding a product:
Code Block | ||
---|---|---|
| ||
<name>product name</name> <price>12.34</price> |
Doing a purchase:
Code Block | ||
---|---|---|
| ||
<customer>your name </customer> <product>product name</product> |
5. Alternatively, you can use code generation link in the Client Operations
widget of the dashboard to invoke the service. However, in the axis2 stub-based clients, there is a limitation in managing session with in-only operations such as 'addProduct'. Therefore, prior to use the code generation, you have to remove mep=http://www.w3.org/ns/wsdl/in-only from the service xml and redeploy the service. This makes the 'addProduct' method return an empty result.
A client using generated stub codes is shown below where the codes were generated with option "Unpacks the databinding classes".
...