WSO2 Governance Registry only allows you to upload one resource at a time. However, a WSDL (or Schema) file can have several imported resources (Schemas and WSDLs) that are required to be uploaded all at once.
Follow the instructions below to create a governance archive of the WSDL (or Schema) file you want to upload, including the imported Schemas and WSDLs placed in a proper directory structure.
- Save the WSDL to your local file system to a folder named, for example, "myWSDL."
- Open the WSDL file and identify the directory structure of the imports. Make absolute Schema locations relative.
- Replace the Schema locations to reflect a relative directory structure. For example, replace with
- Create a folder named "schemas" inside the folder myWSDL. Now, save the Schemas, within the "schemas" folder. For example, save as
- Open each Schema file and fix the locations of the imported Schemas. Make the absolute Schema locations in the Schema files relative as well. For example, replace with
- Save and close the WSDL and Schema files, if you have not done so. Then, create a governance archive of the folder "myWSDL." Name it, for example, "myWSDL.zip." Change the extension of this file from
.gar. Your file should now have the name "myZIP.gar".
- Upload the "myZIP.gar" file to the registry, through the "Browse" sub menu under the "Resources" menu. Now, you should see your WSDL listed under the "WSDLs" section under the "List" sub-menu of the "Metadata" menu.
To upload a Schema file (with imports), you need to follow the above mentioned steps starting from Step 4. You should save the base schema file outside the "schemas" folder. This is just the same as saving the base WSDL file. Also, if you are importing a WSDL that imports other WSDLs, you need to place the imported WSDLs in a folder named "wsdls."
Governance Archives can be used to upload multiple base WSDLs (and Schemas) at the same time. This can be done by placing all the base WSDLs and base Schemas at the top-level folder, and including the others inside folders named "schemas" and "wsdls" as appropriate.
See an example of uploading Schemas with Imports from Local Filesystem into the Registry here.