Develop > Presentation layer > Work with JSP pages > WebSphere Commerce JSP viewer > Create XML files using the XMLGenerator


Generate an XML file using the data bean to XMLGenerator

After you have installed the data bean to XMLGenerator, you can start generating XML files for the data beans.

To generate an XML file using the XMLGenerator:


Procedure

  1. Do one of the following tasks:

    • If you are using a stubbed data bean:

      1. Open the WebSphere Commerce Accelerator

    • If you are using a WebSphere Commerce data bean:

      1. Identify the data bean for which to generate XML.

      2. Populate the WebSphere Commerce database with data for that data bean. The easiest way is to use a starter store. For example, to generate an XML file for the OrderListDataBean then we will want to either place something in the shopping cart, or complete a few orders in the starter store.

      3. Ensure that you have a WebSphere Commerce cookie that can be used to retrieve data. For example, if you submit some orders, as in the previous step, then we will want to log on to the store using the ID that placed those orders, ensuring that you have created the cookie which is needed to run the data bean to XMLGenerator.

  2. Login and go to http:// localhost/webapp/wcs/stores/servlet/DatabeanToXML. The XMLGenerator tool interface will appear.

  3. Enter the fully qualified data bean name in the databean field box.

  4. Enter 1 or 2 in the Maximum length of lists box, which limits the size of the resulting XML file. If you want all of the data printed out, then leave this field blank. Doing so, might result in a large file and can take a while to generate depending on the data bean used.

  5. Check whether to filter out the commandContext and requestProperties objects.

  6. Enter values in the appropriate fields in the table on the page. These values are required for the bean to know how to retrieve data from the database.

  7. Enter the output file name.

  8. Click Generate. A confirmation that the XML file has been generated displays.


Results

If you are using a stubbed out data bean (all of the methods return a default value and no logic is performed), step 5 can be omitted. When using this type of bean, guarantee that it directly or indirectly implements the com.ibm.commerce.beans.DataBean interface.


Previous topic: Install the data bean to XMLGenerator


Next topic: Set up the JSP viewer tool


Related concepts

WebSphere Commerce JSP viewer


Related tasks

Create XML files using the XMLGenerator


+

Search Tips   |   Advanced Search