Processing an Order in a Purchase Order System

Creating the purchaseOrder.xsd Schema

ProcedureTo create the purchaseOrder.xsd schema

  1. In the Projects window, right-click the HTTP-SOAP-PO-BPEL -> Process Files node and select New -> XML Schema from the pop-up menu.

    The XML Schema wizard appears displaying the Name and Location page.

  2. From the Name and Location page of the wizard, enter purchaseOrder as the File Name.

  3. Click Finish. In the Projects window, the Process Files node now contains a subnode labeled purchaseOrder.xsd . The Source Editor contains a tab for the XML schema file, purchaseOrder.xsd, with the Schema view open.

ProcedureTo add a complex type to the XML schema

  1. From the Schema view of the purchaseOrder.xsd, right-click the Complex Type node and select Add Complex Type from the pop-up menu.

  2. From the Add Complex Type dialog box, click OK. A complex type (newComplexType) is added to the second pane of the Schema window and a sequence node is added to the third pane of the Schema window.

ProcedureTo add local elements to the XML schema

  1. From the Schema window, right-click the sequence node and select Add -> Element from the pop-up menu.

    The Add Element dialog box appears.

  2. From the Add Element dialog box, do the following:

    1. Type orderId as the Name.

    2. For Type, select Use Existing Type and select Built-in Types -> int as the Current Selection.

    3. Click OK.

  3. In the same manner, add three additional elements with the values shown in the following table:

    Name 

    Type 

    Current Selection 

    Type 

    customerId 

    Use Existing Type 

    Built-in Type  

    int 

    orderDescription 

    Use Existing Type. 

    Built-in Type 

    String 

    price 

    Use Existing Type. 

    Built-in Type 

    double 

ProcedureTo add a global element

  1. From the left pane of the Schema window, right-click the Elements node, and select Add -> Element from the pop-up menu.

  2. From the Add Element dialog box, do the following:

    1. Type purchaseOrder as the Name.

    2. For Type, select Use Existing Type and select Complex Type -> newComplexType as the Current Selection.

    3. Click OK. A complex type (purchaseOrder) is added to the second pane of the Schema window.

ProcedureTo validate the XML schema

  1. From the Schema Editor's toolbar, click the Validate XML button. Validation begins.

  2. If your validation is successful, click File -> Save All to save your current changes.