Generating 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 your data beans. To generate an XML file using the XMLGenerator:
- Do one of the following tasks:
- If you are using a stubbed data bean:
- If you are using a WebSphere Commerce data bean:
- Identify the data bean for which you want to generate XML.
- Populate the WebSphere Commerce database with data for that data bean. The easiest way is to use a starter store. For example, if you want to generate an XML file for the OrderListDataBean then you will want to either place something in your shopping cart, or complete a few orders in the starter store.
- 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 you 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.
- Login and go to http:// localhost/webapp/wcs/stores/servlet/DatabeanToXML. The XMLGenerator tool interface will appear.
- Enter the fully qualified data bean name in the databean field box.
- 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.
- Check whether to filter out the commandContext and requestProperties objects.
- 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.
- Enter the output file name.
- Click Generate. A confirmation that the XML file has been generated displays.
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 toolRelated concepts
WebSphere Commerce JSP viewer
Easy startRelated tasks
Create XML files using the XMLGenerator