Tutorials > Web services > Define a User Registration Web Service

< Previous | Next >


Define the SyncCustomer schema

This section describes the steps involved in creating a new XML schema definition. The XML schema will define a Web service to create customers. Since this tutorial follows the OAGIS structure, the directories in which the XML schema is placed will follow the OAGIS overlay recommendation. After completing this section, we will have an XML schema that is used to define the Web services.


Procedure

  1. Under the WebContent/xsd/OAGIS/9.0/Overlays directory of the WebServicesRouter project, create a MyCompany folder.

  2. Under the newly created MyCompany folder, create a BODs folder which will contain the service XML schema and a Resources > Nouns folder which will contain the Customer data objects.

  3. To create the Customer.xsd schema file:

    1. In the Enterprise Explorer view, navigate to WebServicesRouter > WebContent > xsd > OAGIS > 9.0 > Overlays > MyCompany > Resources > Nouns.

    2. Right-click the Nouns folder and select New > Other.

    3. In the Select a Wizard dialog box, select XML > XML Schema and click Next.

    4. In the File name field, type Customer.xsd.

    5. Click Finish to create the XML schema file.

    6. In the XML Schema Editor, click the Properties tab.

      1. In the Prefix field, type myco.

      2. In the Target namespace field, type http://www.mycompany.com/schema.

    7. Click the Graph tab.

    8. In the Types section, right-click then click Add Complex Type.

    9. Select the new complex type and click the Properties tab.

      1. In the Name field, type CustomerDemographicsType.

    10. Double-click CustomerDemographicsType.

    11. Right-click inside the CustomerDemographicsType section and select Add Sequence.

    12. Right-click the sequence and select Add Element.

    13. Select the new element and click the Properties tab.

      1. In the Name field, type Gender.

      2. In the Type field, click the ... button and select string.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    14. Repeat steps 8-9 for the IncomeCurrency, MaritalStatus, Hobbies, and AdditionalInformation elements.

    15. Right-click the sequence and select Add Element.

    16. Select the new element and click the Properties tab.

      1. In the Name field, type Age.

      2. In the Type field, click the ... button and select integer.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    17. Repeat steps 11-12 for the Income element.

    18. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    19. In the Types section, right-click then click Add Complex Type.

    20. Select the new complex type and click the Properties tab.

      1. In the Name field, type AuthenticationType.

    21. Double-click AuthenticationType.

    22. Right-click inside the AuthenticationType section and select Add Sequence.

    23. Right-click the sequence and select Add Element.

    24. Select the new element and click the Properties tab.

      1. In the Name field, type Logon.

      2. In the Type field, click the ... button and select string.

    25. Repeat steps 19-20 for the Password, PasswordVerify, ChallengeQuestion, and ChallengeAnswer elements.

    26. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    27. In the Types section, right-click then click Add Complex Type.

    28. Select the new complex type and click the Properties tab.

      1. In the Name field, type AddressType.

    29. Double-click AddressType.

    30. Right-click inside the AddressType section and select Add Sequence.

    31. Right-click the sequence and select Add Element.

    32. Select the new element and click the Properties tab.

      1. In the Name field, type StreetAddress.

      2. In the Type field, click the ... button and select string.

    33. Repeat steps 27-28 for the City, State, Country, and ZipCode elements.

    34. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    35. In the Types section, right-click then click Add Complex Type.

    36. Select the new complex type and click the Properties tab.

      1. In the Name field, type ContactType.

    37. Double-click ContactType.

    38. Right-click inside the ContactType section and select Add Sequence.

    39. Right-click the sequence and select Add Element.

    40. Select the new element and click the Properties tab.

      1. In the Name field, type FirstName.

      2. In the Type field, click the ... button and select string.

    41. Repeat steps 35-36 for the LastName, PhoneNumber, FaxNumber, and Email elements.

    42. Right-click the sequence and select Add Element.

    43. Select the new element and click the Properties tab.

      1. In the Name field, type Address.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:AddressType and click OK.

      3. In the maxOccurs field, select 1.

    44. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    45. In the Types section, right-click then click Add Complex Type.

    46. Select the new complex type and click the Properties tab.

      1. In the Name field, type CustomerType .

    47. Double-click CustomerType.

    48. Right-click inside the CustomerType section and select Add Sequence.

    49. Right-click the sequence and select Add Element.

    50. Select the new element and click the Properties tab.

      1. In the Name field, type DisplayName.

      2. In the Type field, click the ... button and select string.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    51. Repeat steps 45-46 for the ParentOrganization, ProfileType, and PreferredCurrency elements.

    52. Right-click the sequence and select Add Element.

    53. Select the new element and click the Properties tab.

      1. In the Name field, type Store.

      2. In the Type field, click the ... button and select integer.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    54. Repeat steps 48-49 for the PreferredLanguage element.

    55. Right-click the sequence and select Add Element.

    56. Select the new element and click the Properties tab.

      1. In the Name field, type Authentication.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:AuthenticationType and click OK.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    57. Right-click the sequence and select Add Element.

    58. Select the new element and click the Properties tab.

      1. In the Name field, type Contact.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:ContactType and click OK.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    59. Right-click the sequence and select Add Element.

    60. Select the new element and click the Properties tab.

      1. In the Name field, type Demographics.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:CustomerDemographicsType and click OK.

      3. In the minOccurs field, select 0.

      4. In the maxOccurs field, select 1.

    61. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    62. In the Elements section, right-click and select Add Element.

    63. Select the new element and click the Properties tab.

      1. In the Name field, type Customer.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:CustomerType and click OK.

    64. Save the work and close the XML Schema Editor.
    Under the MyCompany/BODs directory, create another XML schema to define the SyncCustomer service that will extend from the OAGIS BusinessObjectDocument.

  4. To create the SyncCustomerType.xsd schema file:

    1. In the Enterprise Explorer view, navigate to WebServicesRouter > WebContent > xsd > OAGIS > 9.0 > Overlays > MyCompany > BODs.

    2. Right-click the BODs folder and select New > Other.

    3. In the Select a Wizard dialog box, select XML > XML Schema and click Next.

    4. In the File name field, type SyncCustomerType.xsd.

    5. Click Finish.

    6. Open SyncCustomerType.xsd.

    7. Click the Properties tab.

      1. In the Prefix field, type myco.

      2. In the Target namespace field, type http://www.mycompany.com/schema.

    8. Click the Graph tab.

    9. Import the BOD.xsd schema file:

      1. Right-click inside the Directives section and select Add Import.

      2. Select the new import and click the Properties tab.

        1. In the Schema location field, click the ... button.

        2. Select Workbench projects and click Next.

        3. Expand WebContent > xsd > OAGIS > 9.0 > Resources > Nouns.

        4. Select BOD.xsd and click Finish.

        5. Click the Properties tab.

        6. In the Prefix field, type oa.

    10. Include the Customer.xsd schema file:

      1. Right-click inside the Directives section and select Add Include.

      2. Select the new include and click the Properties tab.

        1. In the Schema location field, click the ... button.

        2. Select Workbench projects and click Next.

        3. Expand WebContent > xsd > OAGIS > 9.0 > Overlays > MyCompany > Resources > Nouns.

        4. Select Customer.xsd and click Finish.

    11. Right-click inside the Types section and select Add Complex Type.

    12. Select the new complex type and click the Properties tab.

      1. In the Name field, type SyncCustomerDataAreaType.

    13. Double-click SyncCustomerDataAreaType.

    14. Right-click inside the SyncCustomerDataAreaType section and select Add Sequence.

    15. Right-click the sequence and select Add Element Ref.

    16. Select the new element and click the Properties tab.

      1. In the ref field, select oa:Sync.

    17. Right-click the sequence and select Add Element Ref.

    18. Select the new element and click the Properties tab.

      1. In the ref field, select myco:Customer.

      2. In the maxOccurs field, select 1.

    19. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    20. Right-click inside the Types section and select Add Complex Type.

    21. Select the new complex type and click the Properties tab.

      1. In the Name field, type SyncCustomerType.

      2. In the Base type field, click the ... button and select User-defined complex type. Select oa:BusinessObjectDocumentType and click OK.

    22. Double-click SyncCustomerType.

    23. Right-click the bottom sequence and select Add Element.

    24. Select the new element and click the Properties tab.

      1. In the Name field, type DataArea.

      2. In the Type field, click the ... button and select User-defined complex type. Select myco:SyncCustomerDataAreaType and click OK.

    25. Click the arrow in the top left of the XML Schema Editor to return to the schema.

    26. Right-click inside the Elements section and select Add Element.

      1. In the Name field, type SyncCustomer.

      2. In the Type field, click the ... button and select myco:SyncCustomerType.

    27. Save the work and close the XML Schema Editor.
    After completing this section of the tutorial, you can verify that the XML schemas are correct by comparing the source code of the schemas with the source code of Customer.xsd and SyncCustomerType.xsd in the sample zip file.

< Previous | Next >


+

Search Tips   |   Advanced Search