2010/06/18
18 Jun, 2010

Changing default storage locations of schemas, wsdls, policies and services

  • Tharindu Mathew
  • Technical Lead - WSO2

This article applies to WSO2 Governance Registry version 3.5.0 and above. For an article that applies to version 3.0.0 of the Registry please refer here.

The WSO2 Governance Registry treats schemas, WSDLs, policies and services as four special resource types as they play an important role in SOA. These four types are stored at locations that can be changed using the configuration files. Often, it is required to change the default storage locations of these four resource types. How to change the storage location of each of these four types are shown below:

  1. Changing schema storage location

    Schemas can be added in two ways. You can either directly upload a schema or it can be implicitly imported when you add a WSDL file. WSDLs can be added either directly or through a zip archive. Therefore, to change the default location of schemas, 3 locations have to be edited. These are highlighted in red and shown below and is in the registry.xml located at $GREG_HOME/repository/conf.

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

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

 <handler class="org.wso2.carbon.registry.extensions.handlers.XSDMediaTypeHandler">
     <property name="locationConfiguration" type="xml">
         <location>/schemas/</location> 
     </property>
     <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
         <property name="mediaType">application/x-xsd+xml</property>
     </filter>
 </handler>
  1. Changing wsdl storage location

    WSDLs can be added in two ways. Either by adding a direct WSDL or by adding a zip archive. Therefore, to change the default location of wsdls two location have to be edited. These are highlighted in red and shown below and is in the registry.xml located at $GREG_HOME/repository/conf.

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

 <handler class="org.wso2.carbon.registry.extensions.handlers.ZipWSDLMediaTypeHandler">
     <property name="wsdlMediaType">application/wsdl+xml</property>
     <property name="schemaMediaType">application/xsd+xml</property>
     <!--property name="wsdlExtension">.wsdl</property>
     <property name="schemaExtension">.xsd</property>
     <property name="archiveExtension">.gar</property>
     <property name="tempFilePrefix">wsdl</property-->
     <property name="schemaLocationConfiguration" type="xml">
         <location>/schemas/</location>
     </property>
     <property name="wsdlLocationConfiguration" type="xml">
         <location>/wsdls/</location>
     </property>
     <filter class="org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher">
         <property name="mediaType">application/vnd.wso2.governance-archive</property>
     </filter>
 </handler>
 
  1. Changing policy storage location

    Policies can be added by directly adding a policy file. Therefore, to change the default location of policies one location have to be edited. These are highlighted in red and shown below and is in the registry.xml located at $GREG_HOME/repository/conf.

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

    Services can be added by directly through the UI. Therefore, to change the default location of services one location have to be edited. These are highlighted in red and shown below and is in the registry.xml located at $GREG_HOME/repository/conf.

 <staticConfiguration>
     <versioningProperties>true</versioningProperties>
     <versioningComments>true</versioningComments>
     <versioningTags>true</versioningTags>
     <versioningRatings>true</versioningRatings>
     <!-- Location you want to add service and default location will be /services/ -->
     <servicePath>/services/</servicePath>
 </staticConfiguration>
 

Author: Tharindu Mathew
Software Engineer, WSO2 Inc.


 

About Author

  • Tharindu Mathew
  • Technical Lead
  • Home