Tags
11G, artefatos, Business, Deploy, Deployment, Developer, DVM, Fault Policies, JDeveloper, MDS, Meta Data Store, Oracle, oramds, Rules, Scripts, SOA, SOA Suite 11g, Soa-Suite, WSDL, XML, XSD
In SOA Suite 11g there is a widely used option to share artifacts (WSDL, XML, XSD, DVM, Rules, Scripts, Fault Policies, among others …) through MDS – Meta Data Store facilitating the reuse of these artifacts within the SOA projects
I will help you in this post to create and configure the MDS in JDeveloper. My setup and use of MDS in 3 parts as below. Later you can click on the links to see the other parts.
- Part 1: Creating and Configuring MDS
- Part 2: Referencing existing projects to MDS
- Part 3: Sharing the MDS and other servers
When, for example, a BPEL or BPM project is implemented (deploy) your files are stored in MDS and any change in any artifact will be reflected only in MDS requiring only perform deploy only this file and not an entire project.
Once the MDS is set and stored content, referencing within the project is quite simple, inform, to the location, the full path within the MDS and including oramds prefix. See the example:
To reference the XSD that is the way apps/MyCannonical: do –> oramds: /apps/MyCannonical.xsd
Let’s start 🙂
Click File >> New
Will open a screen like below:
Then select Generic Project
Project Name place Artefatos and click Finish
Now right-click on the project Artefatos and click New
Click Folder and then OK
I will create the first folder “apps“
Below is the first folder “apps” created
Note: The Resources folder and the readme.txt file are created automatically.
Repeat this same procedure creating folders “wsdl” and “xsd” inside the “apps“ folder, so they are as follows:
Now you need we configure the adf-config.xml file so that objects (wsdl, xsd and etc ..) created in Artefatos project can be shared with other projects.
To edit the adf-config.xml file click Application Resources in your JDeveloper, go Descriptors >> ADF META-INF >> adf-config.xml and open the file.
Note: The adf-config.xml file is unique for aplication
Locate the following part of your file:
<metadata-namespaces>
<namespace path=”/soa/shared” metadata-store-usage=”mstore-usage_1″/>
</metadata-namespaces>
Now let’s add one more line that part of the file should look like this:
<metadata-namespaces>
<namespace path=”/soa/shared” metadata-store-usage=”mstore-usage_1″/> <namespace path=”/apps” metadata-store-usage=”mstore-usage_2″/>
</metadata-namespaces>
Note: See below we add one more line prefix <namespace …> you should use the codename mstore–usage_2
Now well below that of the XML locate the <metadata-store-usages>
<metadata-store-usages>
<metadata-store-usage id=”mstore-usage_1″>
<metadata-store class-name=”oracle.mds.persistence.stores.file.FileMetadataStore”>
<property name=”metadata-path”
value=”${oracle.home}/integration”/>
<property name=”partition-name” value=”seed”/>
</metadata-store>
</metadata-store-usage>
Let’s now add the other part of the XML that will also reference our artifacts that should look like this:
Note: See below we create another structure of the XML <metadata-store-usage> with some elements more, also note that this tag should be between <metadata-store-usages> — See the S at the end of usage.
<metadata-store-usage id=”mstore-usage_2″ default-cust-store=”true” deploy-target=”true”>
<metadata-store class-name=”oracle.mds.persistence.stores.file.FileMetadataStore”>
<property value=”${user.home}/jdeveloper/mywork/BKP/UansBlogApplication”
name=”metadata-path”/>
<property value=”Artefatos” name=”partition-name”/>
<property name=”repository-name” value=”mds-soa”/>
</metadata-store>
</metadata-store-usage>
Note: If you are also doing this, I suggest copying the contents above and change just the way it is between the <property … that is the path where your application should be, in my case is in /jdeveloper/mywork/BKP/UansBlogApplication,
${user.home} is a variable that will identify what your home. In my case (/home/uans)
Much attention in this way so that it is correct or will not work
To give you a correct refencia the way, go to your to your application and look for the file with .jws extension as indicated below, as this will be the correct path:
See below do not need to put the /home/uans that is already being refenciada by the variable ${user.home} as explained above, then the path will look like this:
- <property value=”${user.home}/jdeveloper/mywork/BKP/UansBlogApplication”
Note: see who is out / at the end
Close your JDeveloper and open again for your changes to take effect.
So far everything is OK, you can already use the oramds: reference to reference your WSDL and XSD …
For example: oramds:/apps/wsdl/SeuContrato.wsdl
Now, with the right mouse button click Artefatos and click Project Properties …
Click Deployment and then New
In the screenshot below place the commons name and click OK
Note: Can be any other name
In the screenshot below click Contributors and then on Add … to have displaced the app where this folder we created in our project
In my case is: /home/uans/jdeveloper/mywork/BKP/UansBlogApplication/Artefatos/apps
Now click on Filters and to the right, select the folders to be shared, in my WSDL and XSD case, then click OK
In the screenshot below then click OK again.
Now click the right button directly in your application, in my case in UansBlogApplication and click Application Properties …
Click Deployment and the right side in New …
Note: Here we create a deployment type Sounds Bundle, so will give soabundle name
So Archive Type in place the SOA Bundle option
In Name: place soabundle and click OK
Now click Dependencies and the right side select the commons option Artefatos.jpr and click OK
In the screenshot below click OK again
Okay, now you can make the deploy locally of its MDS artifacts.
Just remember that to change any XSD or WSDL file that is within the Artefatos project, apps folder .. you should do the deploy locally normally, here’s how:
In your Menu, click Application >> Deploy >> soabundle
On the next screen click Next, leaving marked the default option in the case Deploy to Application Server
Click Next again
In this option, select localhost and click Next
Click Next again
Click Finish
In the guide below its JDeveloper Deployment Log in check appeared the message
—- Deployment finished. —-
Ready … deploy your MDS was successful.
Warning: I recommend lower and up your AdminServer for your changes to take effect but often this is not necessary.
But to distribute the MDS artifacts to a different environment of the local environment on a server for example, we create a simple project called Common (or any other name you wish).
To do this:
Click File >> New
Will open a screen like below:
Then select Generic Project
Project Name Common place and Finish
Now right-click on the Common project and click Project Properties …
Click Deployment and to the right click New
Now in Archive Type: let selected JAR File option and Name: Common place and click OK
Much attention now on the screen below:
Click Contributors and right click the Add and add the Artefatos folder of your project and then click OK
Note: See below that is not the “apps“ folder as added earlier, it will be just to the Artefatos folder in my case will be: /home/uans/jdeveloper/mywork/BKP/UansBlogApplication/Artefatos
Now click on Filters and select “ONLY” the apps folder that automatically selects the wsdl and xsd folders as below and click OK
In the screenshot below click OK again
To make sure that everything was successful we will do two very simple tests.
First Test:
Copy a WSDL and XSD for any wsdl and xsd files you create in artifacts
Below see that copied the WSDL and XSD of my project HelloWorldBPEL
Just a note here, as in the WSDL artifacts HelloWorld.wsdl my folder Artefatos/wsdl edited my schemaLocation to identify where this my xsd, in the event: ../xsd/SelecDBAdapterBPELProcess.xsd
Now create a project called Teste and select the Template Base on a WSDL option
Now in WSDL URL put the path and file name where your WSDL is that we have created in Artefatos, remembering that should start using oramds prefix:
If so:
oramds:/apps/wsdl/HelloWorld.wsdl (Do not forget to put the name exactly the same file with the extension wsdl)
After that, press the TAB key on your keyboard and if it appears the Transaction option and the Port Type as shown below means that the BPEL managed to find in your WSDL Artefatos folder, simply click on OK and start using all of your project Artefatos 🙂
Second Test:
Take a locally deploy its Common project and check the Common.jar file was generated if there contains the WSDL and XSD files we place in Artefatos project.
Click right button on the Commons project select the Deploy option >> Common to JAR file
Check as follows if the Common.jar file was generated and in this file are the WSDL and XSD files we place in the Artefatos folder
Okay, now this Common.jar file can now be sent to any server to deploy.
Hugs and to the Next
/:-D