Tutorials > Program model > Web services > Create a new WebSphere Commerce BOD service module
Generate the SDOs for the TutorialStore noun
Once you have the base code and project structure generated using JET, you now can generate the service data objects (SDOs) that implement the logical data model of the TutorialStore noun, which is defined in the TutorialStore.xsd file. SDOs are Java objects that represent the nouns in the logical model. You can generate these nouns from the noun definition.
As a quick reminder, a noun is defined as an XML schema and can include primitive XML schema types, new complex types, or reuse WebSphere Commerce and Oagis9 predefined type constructs. The TutorialStore noun represents the logical data model of the new service module that you are building in this tutorial. In the diagram below, you can see how generating the SDOs fits into the overall customization process:
Before you start generating the data objects, set up the predefined WebSphere Commerce type constructs, and to update the JET-generated TutorialStore.xsd template with the own noun definition.
Procedure
- Update the generated TutorialStore noun:
- Open the BODTutorialStore-DataObjects/xsd/OAGIS/9.0/Overlays/MyCompany/Commerce/Resources/Nouns/TutorialStore.xsd file in a text editor.
- Replace the generated content with the contents of the following download: TutorialStore.xsd.
Open the download in a text editor (not an internet browser) to copy the contents
- Open the BODTutorialStore-DataObjects\ecore folder.
- Right-click BODTutorialStore.genmodel and select Reload.
- Select XML Schema. Click Next.
- Click Next again.
- Click Add.
- Expand the WebServicesRouter\WebContent\component-services\ecore folder.
- Select Foundation.genmodel and Oagis9.genmodel.
- Click OK.
- In the Referenced generator models area, select com.ibm.commerce.oagis9.datatypes.codelists, com.ibm.commerce.oagis9.datatypes.unqualifieddatatypes, com.ibm.commerce.oagis9.datatypes under the Oagis9 model and com.ibm.commerce.foundation.common.datatypes under the Foundation model. Click Finish.
- Open BODTutorialStore.genmodel.
- Right-click the BODTutorialStore element under the BODTutorialStore root and select Generate Model Code. This generates the BODTutorialStore-DataObjects code.
- Verify that the BODTutorialStore-DataObjects project has no compilation errors.
Lesson checkpoint
In this step, you used the Eclipse Modeling Framework (EMF) to generate Service Data Objects (SDO) from the TutorialStore noun which is defined in the TutorialStore.xsd file.