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

SOA governance artifacts such as schemas, WSDLs, policies and services are given special preference in the WSO2 Governance Registry. Unlike other resource types, the storage location of these special types can be configured directly through configuration files.

Date: Fri, 18th Jun, 2010
Level: Introductory
Reads: 1371 Comments: 0 | Login or register to post comments
Tharindu Mathew

WSO2 Inc.
mccloud35's picture

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.

library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
KeellsSuper is a leading supermarket chain with 50-plus outlets in Sri Lanka, and it offers the only online supermarket in the country. In 2005, JKH implemented SAP ERP across it’s 70 subsidiaries...
Thursday, February 16th 2012, 09.00 AM (PST)

Thursday, February 16th 2012, 10.00 AM (GMT)