(1/2) Using the MetaData Services (MDS) in a SOA environment
Before I talk about the advantages en methods of using the MDS, I want to introduce myself, because this is my first public post on the AMIS technology blog. My name is Robert van Mölken and I’m 26 years old. I’m now actively working, as a SOA Consultant / Developer, for nearly 5 years. My main toolstack is SOA Suite (3,5 years 10gR3 and 1,5 years 11gR1), but also have experience with opensource BPEL / ESB alternatives from Apache.
In many big SOA application all the composites use the same canonical1 data model (message definitions) for their service contracts. Many entities and elements (complex- and simple types) are reused. Therefor it is not a good choice to use a local copy for the service contracts (WSDLs) and message definition files (XSDs) in each SOA composite project.
If you do so and a mayor (common) part of the message definitions changes then you need to update all the SOA composite projects, where these files are used, with the new version of the files. Oracle created the MDS to solve this issue. MDS stands for MetaData Services. The MDS holds all kind of xml-based files, like WSDLs, XSDs, Domain Values Maps but can also hold fault policies and event definitions (for Event Delivery Network).
There are two versions of the MDS; a file-based and a database version. The file-based version is being used as a local MDS for development and can be saved in a subversion repository, which every developer then can use with their own working copy of the repository.
The database version is being used as a remote MDS. A SOA server instance, running on Weblogic server, uses its own database MDS and can’t use a local MDS. So for every successful implementation of the MDS we need to create both a local as a remote MDS.
Local directory structure for MDS
The first step is to create a local directory structure where we can place our message definitions. The base structure needs to implement an apps folder on the highest level of the MDS seed folder. A seed folder is the name that Oracle uses for saying root folder. I will give an example of a directory structure I use in general. Sources of example are at end of article2.
Create resource connection to local MDS
Before the resources from our mds-store resource directory can be used the first step is to configure the connection to the local MDS directory.
Open JDeveloper, in the Resource Palette click on the
button for creating new connections and select the item New Connection a SOA-MDS. A dialog “Create SOA-MDS Connection” will open. Click on the radiobutton IDE Connections if it is not choosen on default. Enter as Connection Name Local{Project}MDS where {Project} holds the name of the project you’re working on.
Select under Connection Type a File Based MDS for creating a connection to a local MDS and browse to the root of the MDS on your filesystem. The root of the MDS is the directory called mds-store and click on the seed soa-infra.
Why not mds-store? Because a MDS connection is always to a seed directory. Our seed is a reference to the soa-infra partition of the DB based MDS.
Back in the connection window click on the
button  to the if the directory is accessible. If correct the test connection gives a success message. Click OK to save connection.
Create resource connection to remote MDS
If you want to be clear if your local MDS is fully sync with the remote MDS of the SOA server also create a resource connection to the remote MDS. A remote MDS is a special database schema that holds the same data as a local MDS, but the files are not saved in a binary way.
In the Resource Palette click on the
button for creating new connections and select the item New Connection -> SOA-MDS. A dialog “Create SOA-MDS Connection” will open. Click on the radiobutton IDE Connections if it is not choosen on default. Enter as Connection Name Remote{Project}MDS where {Project} holds the name of the project you’re working on.
Select under Connection Type a DB Based MDS for creating a connection to a remote MDS. In the connection dropdown a list of database connections is presented. If you never created a connection to the remote MDS of your environment you won’t find the correct connection in the list. If so you need to create a new database connection to the MDS schema of your environment.
Click on the
icon at the right side of the dropdown to add a new connection. A dialog “Create Database Connection” will open. Click on the radiobutton IDE Connections if it is not choosen on default. Enter as Connection Name {Project}SOAMDS.
Select the correct Connection Type for the database you are using. At AMIS we generaly use Oracle (JDBC). Specify the username with the name of the MDS schema (e.g. dev_mds)and the correct password. At last we need to change the setting of the JDBC URL. Specify the Host Name, SID and JDBC Port of the database instance where the SOA repository is present.
Click on
to check if the settings are correct. After success click OK.

Back at the “Create SOA-MDS Connection” dialog it will be refreshed and the database connection we just created is selected. Also the list of MDS partitions is refreshed and contains some options.
In the Select MDS partition list select the option soa-infra.
Click on
to check if the settings are correct. After success click OK.
Both MDS connections are now configured and displayed in the Resource Palette under SOA-MDS. If you expand to the Local{Project}MDS and Remote{Project}MDS, you will that the have both different folders. The local MDS has two apps defined, but the remote MDS has an empty apps folder.
To browse, open and edit the file in de local MDS, create a SOA application and project MDSLocalStore and use the mds-store folder as the base directory, so that both JWS as JPR file are placed in the same folder.
Synchronize local with remote MDS / deploy to MDS
Before you can deploy a SOA composite that uses WSDLs and XSDs from the MDS you need to synchronize the new files in the local MDS to the remote MDS of the server. To do this simple and quick it is better to use ANT build scripts to successfully deploy the correct resources.
Open the application file MDSLocalStore.jws, that resides in the mds-store directory, that you just created. You can open this file by select File -> Open and browse to the mds-store folder and selecting the file. The application looks something like this if you opened it:
There are three files in the resources folder. build.properties holds the global properties like build directory, environment settings and which applications to deploy that resides in the local MDS.

The last property defines to which server environment we will deploy to and which env file is used.
Then you have the env.{env}.properties file. This file contains the server settings of the specific server environment. The build file uses the one that represents the deployment.env value.
We’re now ready to deploy to our remote MDS. Right-click on the build.xml file and select the option: Run Ant Target -> deployMDS. This file can also be run on the command line or by a build server.
If everything is setup right the resources are deployed to the remote MDS.
In part 2 i’m going to describe how to use the MDS in SOA composites.
References
1 Basic, canonic, canonical: reduced to the simplest and most significant form possible without loss of generality, e.g., “a basic story line”; “a canonical syllable pattern.”
2 Download the sources here, including deploy scripts. It is based on deployment script of Edwin Biemond and part of Emiel Paasschens
Related posts:
- EJB3.0 in Netbeans 5.0
- Implementing Web Services backed by a Database PL/SQL API using the Oracle Service Bus
- Eclipse/CVS quickstart
- AMIS Library System – JHeadstart 9.0.5.x (BC4J, JSP+JSTL) Demo Application released
- Calling an EJB from a SOA Composite Application using the EJB Binding based on Java Interface
This entry was posted by Robert van Molken on February 10, 2012 at 1:00 pm, and is filed under SOA & Oracle Fusion Middleware. Follow any responses to this post through RSS 2.0.You can skip to the end and leave a response. Pinging is currently not allowed.
-
Leave a Reply Cancel reply
-
-
Great work in sharing your Knowledge.
I see that your using my mds scripts and that you add some extra code which changes the endpoints in the wsdl’s
Beware aware that you also need to do this for acceptance and production.
A better approach is remove this endpoint code keep the generated sar files, deploy these to acceptance etc and use deployment plans on the composites , to override the endpoints .
Then you know for sure that the same code exists on acceptance and production.
thanks Edwin
Â
 - Comment Feed for this Post
- Weblogic Admin and Managed servers as a Windows service
- ADF DVT Speed Date: Interactive Bubble Graph
- (2/2) Using the MetaData Services (MDS) in a SOA environment
- Creating an hierarchical user structure in embedded LDAP of weblogic
- Fanning Out Events on the Oracle SOA Suite 11g Event Delivery Network
- Dear Java/JEE developer – why should you care about ADF?
- ADF interaction with business service – an ongoing discussion
- Oracle SOA Suite 11g PS 5 introduces BPEL with conditional correlation for aggregation scenarios
- Configuration of BAM and BPM for process analytics
- 5 november: Masterclass SOA voor Oracle Database Professionals












It was deleted after the move. Put up a different version as an example.