Uploading Schemas with Imports from Local Filesystem into the WSO2 Governance Registry

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Senaka Fernando
  • 2 Jan, 2010

Step 1 Create a Governance WSDL Archive containing all the schemas that you wish to upload into the WSO2 Governance Registry, as explained in here. Since we don't have a WSDL file as explained in the documentation, we will be starting from step 4. Follow the steps below before attempting step 7. This archive should contain the base schema file, and all the child imports. We will be using https://131.107.72.15/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?xsd=xsd1 as our base schema in this example.

Step 2 Identify the target namespace of the base schema. This is usually defined as an attribute of the root element of the schema definition. For the schema file https://131.107.72.15/SoapWsdl_BaseDataTypes_XmlFormatter_Service_Indigo/BaseDataTypesDocLitB.svc?xsd=xsd1, the target namespace is https://tempuri.org/.

Step 3 Create a dummy WSDL file which will import the schema file into the registry. The contents of this file should have a format as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://schemas.xmlsoap.org/wsdl/" xmlns:xsd="https://www.w3.org/2001/XMLSchema" targetNamespace="TARGET_NAMESPACE_OF_BASE_SCHEMA/wsdl">
  <types>
    <xsd:schema>
      <xsd:import namespace="TARGET_NAMESPACE_OF_BASE_SCHEMA" schemaLocation="schemas/NAME_OF_BASE_SCHEMA"/>
    </xsd:schema>
  </types>
</definitions>

Use the name of the base schema (which should be available in the schemas folder of your Governance WSDL Archive) in place of NAME_OF_BASE_SCHEMA, and its target namespace in place of TARGET_NAMESPACE_OF_BASE_SCHEMA. This should now look like,

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://schemas.xmlsoap.org/wsdl/" xmlns:xsd="https://www.w3.org/2001/XMLSchema" targetNamespace="https://tempuri.org/wsdl">
  <types>
    <xsd:schema>
      <xsd:import namespace="https://tempuri.org/" schemaLocation="schemas/xsd1.xsd"/>
    </xsd:schema>
  </types>
</definitions>

Add this WSDL file by the name dummy.wsdl (or any other name that you wish, which is not a name of a WSDL that has already been added to the WSO2 Governance Registry), and save it inside the myWSDL folder.

Step 4 Complete the creation of the Governance WSDL Archive (follow steps 7 and 8 of the documentation).

Step 5 After having uploaded the Governance WSDL Archive, you should see the schemas listed under the Metadata --> List --> Schemas menu page. You should also see the dummy.wsdl (or the WSDL file by the name that you chose) listed under the Metadata --> List --> WSDLs menu page. You may delete this WSDL file, as it is not required (or leave it as it is if you don't mind), to complete the 5 step process of uploading schemas with imports from the local filesystem into the WSO2 Governance Registry.

Applies To:- WSO2 Governance Registry-3.0.1 or later.

Author

Senaka Fernando, Software Engineer, WSO2, [email protected]