Defining the XML schema that extends the OAGIS BusinessObjectDocument

In this lesson, you define the XML schema, SyncCustomer. The SyncCustomer XML schema defines a web service to extend the OAGIS BusinessObjectDocument. Since this tutorial follows the OAGIS structure, the directories in which the XML schema is placed follows the OAGIS overlay recommendation. When you complete this lesson, you have an XML schema that is used to define the web services.

Procedure

  1. Create the SyncCustomer.xsd schema file that you must use to define the SyncCustomer service to extend the OAGIS BusinessDocument:
    1. In the Enterprise Explorer view, go to WebServiceRouter/WebContent/xsd/OAGIS/9.0/Overlays/MyCompany/BODs.
    2. Right-click the BODs directory; select New > Other.
    3. In the Select a wizard dialog, select XML/XML Schema; click Next.
    4. In the file name field, enter SyncCustomer.xsd.
    5. Click Finish.
  2. Open the SyncCustomer.xsd schema file in the XML schema editor to set the schema properties
    1. Right-click the SyncCustomer.xsd file; click Open.
    2. Click the Properties tab.
    3. In the Prefix field, enter myco
    4. In the Target namespace field, enter http://www.mycompany.com/schema
  3. Import the BOD.xsd schema file into the SyncCustomer.xsd schema file.
    1. Click the Design tab.
    2. In the View menu, select Detailed.
    3. In the Directives section, right-click; click Add Import.
    4. Select the new import and click the Properties tab.
    5. Click the Browse button to the right of the Schema location field.
    6. In the Select XML schema file dialog, select Workbench projects; click Next
    7. Go to the WebServicesRouter/WebContent/xsd/OAGIS/9.0/Resources/Nouns directory.
    8. Select the BOD.xsd file; click Finish.
    9. In the Directives section, select the BOD.xsd file and click the Properties tab.
    10. In the Prefix field, enter oa.
  4. Include the Customer.xsd schema file into the SyncCustomer.xsd schema file:
    1. In the Directives section for the SyncCustomer.xsd schema file in the XML schema editor, right-click; click Add Include.
    2. Select the new include; click Properties.
    3. Click the Browse button to the right of the Schema location field.
    4. In the Select XML schema file dialog, select Workbench projects; click Next.
    5. Go to the WebServicesRouter/WebContent/xsd/OAGIS/9.0/Overlays/MyCompany/Resources/Nouns directory.
    6. Select the Customer.xsd schema file; click Finish.
  5. Create the complex type SyncCustomerDataAreaType for the SyncCustomer.xsd schema file.
    1. In the Types section for the SyncCustomer.xsd schema file in the XML schema editor, right-click; click Add Complex Type.
    2. Select the new complex type; click the Properties tab.
    3. In the name field, enter SyncCustomerDataAreaType.
    4. Double-click SyncCustomerDataAreaType to open the complex type for editing.
    5. Right-click inside the SyncCustomerDataAreaType section and select Add Sequence.
    6. Right-click the sequence and select Add Element Ref.
    7. Select the new element reference and click the Properties tab.
    8. In the reference field, select Browse....
    9. Select Sync; click OK.
    10. Right-click the sequence and select Add Element Ref.
    11. Select the new element reference and click the Properties tab.
    12. In the reference field, select Browse....
    13. Select Customer; click OK.
    14. In the Maximum Occurrence field, enter 1.
    15. Ensure that your design for the complex type SyncCustomerDataAreaType resembles the following screen capture:
      SyncCustomerDataAreaType
  6. Click the show schema index view Show schema index view button in the upper left of the XML Schema Editor to return to the schema.
  7. In the XML Schema Editor, create the SyncCustomerType type for the SyncCustomer.xsd schema file.
    1. Click the Design tab.
    2. In the View menu, select Detailed.
    3. In the Types section, right-click the section and select Add Complex Type.
    4. Select your new complex type and click the Properties tab.
    5. In the Name field, type SyncCustomerType.
    6. In the Inherit From field, select Browse....
    7. Select BusinessObjectDocumentType; click OK.
    8. Double-click SyncCustomerType to open the complex type for editing.
    9. Right-click SyncCustomerType and select Add Sequence.
    10. Create the element DataArea with a user defined complex type for the SyncCustomerType sequence:
      1. Right-click the sequence and select Add Element
      2. Select the new element and click the Properties tab.
      3. In the Name field, type DataArea.
      4. In the Type field, select Browse....
      5. In the Set Type dialog, select SyncCustomerDataAreaType; click OK.
    11. Ensure that your design for the complex type SyncCustomerType resembles the following screen capture:
      SyncCustomerType
  8. Click the show schema index view Show schema index view button in the upper left of the XML Schema Editor to return to the schema.
  9. In the XML Schema Editor, create the element SyncCustomer type for the schema:
    1. Click the Design tab.
    2. In the View menu, select Detailed.
    3. In the Elements section, right-click the section and select Add Element.
    4. Select your new element and click the Properties tab.
    5. In the Name field, type SyncCustomer.
    6. In the Type field, select Browse....
    7. In the Set Type dialog, select SyncCustomerType; click OK.
    8. Ensure that your design for the schema SyncCustomer.xsd resembles the following screen capture:
      SyncCustomer.xsd
  10. Save your work and close the XML Schema Editor.