Adding a Schema
XML Schema is one of many asset models supported by the WSO2 Governance Registry. Follow the steps below to add a new Schema to the Governance Registry using the G-Reg Publisher.
- Log in to the G-Reg Publisher using the following URL and admin/admin credentials:Â https://<G-REG_HOST>:<G-REG_PORT>/publisher
- Click the Add button of the Schemas box as shown below.
- Select whether to import the Schema from URL or upload it from a file as shown below.
If you selected Import Schema from a URL, specify the URL of the Schema, its name and version as shown below. Â
During the Schema import, G-Reg provides WSDL validation (not supporting WSDL2), WS-I Validation, and Schema Validation. WSDL and Schema validation requires a connection to the internet for the very first time, and will not work on systems without internet connectivity. Instead of just storing the required asset in the repository, G-Reg does some other tasks that are specific to the metadata type, and those information are mentioned on metadata type-based descriptions. You can disable WSDL and Schema validation in the
<G-REG_HOME>/repository/conf/registry.xml
file.If you selected Upload Schema from a file, click Browse to select a single Schema file or an archived file (in .zip or .gar extension) containing multiple Schema files to upload it. Then specify its version as shown below.Â
Governance Archives can be used to upload multiple base Schemas at the same time. This can be done by placing all the base Shemas at the top-level folder of the archive (.zip or .gar file), and including the others inside a directory named "
schema
". For information on uploading a Schema with several associated resources (e.g. WSDLs and other Schemas), see Adding a Schema with other associated assets.- Click Create.
- Refresh the screen to view the new Schema artifact you added as shown below or click the Schemas button in the top menu.
Adding a Schema with other associated assets
Follow the instructions below to upload schemas with associated resources from the local filesystem into the WSO2 Governance Registry.Â
- Save the base Schema in your local file system to a directory (e.g.Â
mySchema
). - Identify the target namespace of the base schema. This is usually defined as an attribute of the root element of the schema definition.Â
- Change the namespace and the path of the Schema in the associated resources accordingly.
Create a folder named "
wsdls
" inside themySchemaÂ
directory. Now, place the WSDLs within the "wsdls
" folder. ÂIf you are importing a Schema that has other associated Schemas, place the associated Schemas in a directory named "
schemas
."- Save and close the Schema and all associated files.Â
- Create a Governance Archive of theÂ
mySchema
 directory (e.g.ÂmySchema.zip
 orÂmySchema.gar
). - Upload the archived file to the Governance Registry using the G-Reg Publisher. You can browse and view all the uploaded assets added separately in each asset type menu.