Venkat,
The HTTP operation (GET/POST/DELETE/PUT) is made available as a connector property (called httpOperation) in your
BizDoc. You typically need to create a single top-level BizDoc that reads the property, and performs the appropriate logic to call another BizDoc for each of the individual operations.
For testing purposes, you can print out all the connector properties, plus any other session variable, from you BizDoc with this command:
| Code: |
<sessionVariables xa:show_session_variables="" />
|
xa:show_session_variables will take a regular expression an print only what you want. To print only the httpOperation, use this form:
| Code: |
<sessionVariables xa:show_session_variables="httpOperation" />
|
The logic in your top level BizDoc needs to read the httpOperation variable, which is accessed as a session variable. A 'switch' statement would look like this:
| Code: |
<xa:switch xa:value="$xavar:httpOperation$">
<xa:case xa:value="GET">
<callBizDocGET />
</xa:case>
<xa:case xa:value="PUT">
<callBizDocPUT />
</xa:case>
<xa:case xa:value="DELETE">
<callBizDocDELETE />
</xa:case>
<xa:case xa:value="POST">
<callBizDocPOST />
</xa:case>
<xa:default>
<invalidOperation />
</xa:default>
</xa:switch>
|
For scenario 1, you likely want to use an alias for your BizDoc (xa:alias on the root of the BizDoc). You might have policy.xbd in folder 'test', which is invoked using the fully qualified name "test/policy.xbd". You can create an alias for this called 'test/policy', so the ".xbd" doesn't have to show up on the URI. It is this BizDoc that should check the httpOperation and call the appropriate BizDoc for the proper operation.
If you want to get rid of the '/xaware/bizview' from the URI, you can configure the container and servlet (called XAServlet.class). Tomcat lets you specify a root context by changing the name of xaware.war to ROOT.war. To remove the /bizview portion, you would have to modify web.
XML to add a servlet mapping (pattern '/*' to be processed by XAServlet).
For scenario 2, we have a URI segment mapping feature which will translate something like '/test/policy/1' to '/test?policy=1'. This is the urlParamMap that is accessible through the JMX console, or by setting a connector property in the
Spring config for HTTPConnectorProperties (conf/servlet/spring/Connectors.xml). I would actually recommend sticking with query string parameters, unless you have a firm requirement to not use query string syntax.
-Kirstan