Deploying MDS artifacts

The MDS, or Metadata Store, is a database-based repository that stores various artifacts that can be referenced from within your SOA code. This can include schemas (XSD files), WSDLs, fault policies and bindings, Domain Value Maps (DVMs), configuration files, and more. The beauty of MDS is that all these artifacts can be shared between your SOA and OSB code, thus taking advantage of reusability.

Often, it is needed to export the contents of MDS either for backup, export, or management purposes. Fortunately, Oracle has provided an Ant target that allows the easy export of all or portions of the MDS into a single JAR file. Once the JAR file is exported, it can be unzipped to your local filesystem and browsed using any file browser. Similarly, it is possible to take a packaged MDS JAR file and import it to any environment.

Exporting MDS artifacts with Ant

This command demonstrates how to execute Ant to export the contents of your MDS to a single JAR file:

source setAntEnv.sh
cd $ORACLE_HOME/bin
ant -f ant-sca-deploy.xml exportSharedData -DserverURL=$SOAURL/soa-infra/deployer -Duser=$USERNAME -Dpassword=$PASSWORD -DjarFile=SOAMetaData.jar -Dpattern=**

The SOAMetaData.jar JAR file can now be unzipped and browsed through the filesystem. When extracted to a temporary folder such as /tmp/svn, it may extract the following files:

/tmp/svn/SOAMetaData/faultPolicies/fault-bindings.xml
/tmp/svn/SOAMetaData/faultPolicies/fault-policies.xml

These files can now be navigated through the filesystem.

The pattern argument can be used to filter the contents you wish to export, allowing you to pick and choose what you want to export should you choose not to export the entire MDS content. For example, specifying a pattern of /apps/SOAMetaData/dvm/**;/apps/SOAMetaData/faultPolicies/** will only export the artifacts under those two subfolders within the MDS.

Importing artifacts to the MDS with Ant

Since MDS artifacts and contents are exported as JAR files, it makes sense for artifacts to be imported in the same manner.

For example, you may have the following files that you just updated on your local filesystem and wish to import them to the MDS. This may include fault policies, DVMs, and schemas located in the following local directory structure:

/tmp/svn/SOAMetaData/faultPolicies/fault-bindings.xml
/tmp/svn/SOAMetaData/faultPolicies/fault-policies.xml
/tmp/svn/SOAMetaData/dvm/CurrencyCode.dvm
/tmp/svn/SOAMetaData/xsd/ErrorHandling/errorEvent.xsd

Firstly, you should zip up the contents of the ~/SOAMetaData subfolder, generating a single SOAMetaData.jar file:

cd /tmp/svn
zip -r SOAMetaData.jar SOAMetaData

The JAR file is now ready to be imported to the MDS, maintaining the same directory structure:

source setAntEnv.sh
cd $ORACLE_HOME/bin 
ant -f ant-sca-deploy.xml deploy -Dwl_home=/u01/app/middleware/wlserver_10.3 -Doracle.home=$ORACLE_HOME -DserverURL=$SOAURL/soa-infra/deployer -Duser=$USERNAME -Dpassword=$PASSWORD -Doverwrite=true -DforceDefault=true -DsarLocation=SOAMetaData.jar
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.122.11