2009/10/12
12 Oct, 2009

Configuration for Storing WSDLs, Schemas and Policies in the WSO2 Governance Registry

  • Senaka Fernando
  • Director Solutions Architecture - WSO2

In just 4 simple steps, Senaka explains how to configure the locations where you store WSDLs, Schemas and Policies in the WSO2 Governance Registry.

Step 1

Download the latest version of WSO2 Governance Registry from here.

Extract the downloaded zip in to a directory in your file system. We will call this GREG_HOME.

Step 2

Go to GREG_HOME/conf directory and open registry.xml file.

To change the location at which you need to store WSDLs (and imported Schemas) edit,

    <handler class="org.wso2.carbon.registry.extensions.handlers.WSDLMediaTypeHandler">
        <property name="schemaLocationConfiguration" type="xml">
            <locationType>absolute</locationType>
            <location>/governance/schemas/</location>
        </property>
        <property name="wsdlLocationConfiguration" type="xml">
            <locationType>absolute</locationType>  <!-- absolute or relative -->
            <location>/governance/wsdls/</location>
        </property>
        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
            <property name="mediaType">application/wsdl+xml</property>
        </filter>
    </handler>

To change the location at which you need to store Schemas added separately (not as WSDL imports) edit,

    <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
        <property name="locationConfiguration" type="xml">
            <locationType>absolute</locationType>  <!-- absolute or relative -->
            <location>/governance/schemas/</location>
        </property>
        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
            <property name="mediaType">application/x-xsd+xml</property>
        </filter>
    </handler>

To change the location at which you need to store Policies edit,

    <handler class="org.wso2.carbon.registry.extensions.handlers.PolicyMediaTypeHandler">
        <property name="policyLocationConfiguration" type="xml">
            <location>/governance/policies/</location>
        </property>
        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
            <property name="mediaType">application/policy+xml</property>
        </filter>
    </handler>

Step 3 (applies to WSO2 Governance Registry-3.0.1 or later)

To change the location where WSDLs (and imported Schemas) uploaded through a Governance WSDL Archice (.gwa) edit,

    <handler class="org.wso2.carbon.registry.extensions.handlers.ZipWSDLMediaTypeHandler">
        <property name="wsdlMediaType">application/wsdl+xml</property>
        <!--property name="wsdlExtension">.wsdl</property>
       <property name="archiveExtension">.gar</property>
       <property name="tempFilePrefix">wsdl</property-->
        <property name="schemaLocationConfiguration" type="xml">
            <locationType>absolute</locationType>
            <location>/governance/schemas/</location>
        </property>
        <property name="wsdlLocationConfiguration" type="xml">
            <locationType>absolute</locationType> <!-- absolute or relative -->
            <location>/governance/wsdls/</location>
        </property>
        <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
            <property name="mediaType">application/vnd.wso2.wsdl-archive</property>
        </filter>
    </handler>

Step 4

Save and close the file. Restart the WSO2 Governance Registry instance for the changes to take effect.

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

Author

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

 

About Author

  • Senaka Fernando
  • Director Solutions Architecture
  • WSO2