Tags

, , , , , , , , , , , , , , , , , , , ,

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.

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

Imagem Blog UansCarvalho

Will open a screen like below:

Then select Generic Project

Imagem Blog UansCarvalho

Project Name place Artefatos and click Finish

Imagem Blog UansCarvalho

Now right-click on the project Artefatos and click New

Imagem Blog UansCarvalho

Click Folder and then OK

Imagem Blog UansCarvalho

I will create the first folder “apps

Imagem Blog UansCarvalho

Below is the first folder “appscreated

Imagem Blog UansCarvalho

Note: The Resources folder and the readme.txt file are created automatically.

Repeat this same procedure creating folders wsdlandxsd” inside the “apps folder, so they are as follows:

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Locate the following part of your file:

 <metadata-namespaces>
      <namespace path=”/soa/shared” metadata-store-usage=”mstore-usage_1″/>
</metadata-namespaces>

Imagem Blog UansCarvalho

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 mstoreusage_2

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

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 …

Imagem Blog UansCarvalho

Click Deployment and then New

Imagem Blog UansCarvalho

In the screenshot below place the commons name and click OK

Note: Can be any other name

Imagem Blog UansCarvalho

In the screenshot below click Contributors and then on Add to have displaced the app where this folder we created in our project

Imagem Blog UansCarvalho

In my case is: /home/uans/jdeveloper/mywork/BKP/UansBlogApplication/Artefatos/apps

Imagem Blog UansCarvalho

Now click on Filters and to the right, select the folders to be shared, in my WSDL and XSD case, then click OK

Imagem Blog UansCarvalho

In the screenshot below then click OK again.

Imagem Blog UansCarvalho

Now click the right button directly in your application, in my case in UansBlogApplication and click Application Properties

Imagem Blog UansCarvalho

Click Deployment and the right side in New

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Now click Dependencies and the right side select the commons option Artefatos.jpr and click OK

Imagem Blog UansCarvalho

In the screenshot below click OK again

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

On the next screen click Next, leaving marked the default option in the case Deploy to Application Server

Imagem Blog UansCarvalho

Click Next again

Imagem Blog UansCarvalho

In this option, select localhost and click Next

Imagem Blog UansCarvalho

Click Next again

Imagem Blog UansCarvalho

Click Finish

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Will open a screen like below:

Then select Generic Project

Imagem Blog UansCarvalho

Project Name Common place and Finish

Imagem Blog UansCarvalho

Now right-click on the Common project and click Project Properties

Imagem Blog UansCarvalho

Click Deployment and to the right click New

Imagem Blog UansCarvalho

Now in Archive Type: let selected JAR File option and Name: Common place and click OK

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Now click on Filters and select ONLY” the apps folder that automatically selects the wsdl and xsd folders as below and click OK

Imagem Blog UansCarvalho

In the screenshot below click OK again

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Now create a project called Teste and select the Template  Base on a WSDL option

Imagem Blog UansCarvalho

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  🙂

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

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

Imagem Blog UansCarvalho

Imagem Blog UansCarvalho

Okay, now this Common.jar file can now be sent to any server to deploy.

 


Hugs and to the Next

/:-D