Tuesday, July 12, 2011

Implementing MDS in Oracle SOA 11G

MDS is used as a repository for managing and reusing shared resources like XSD, WSDL, XSL files.
MDS should be implemented from day 1 of development otherwise developers will run into XSD mismatch, also during production it will be very tough to keep the XSD same.

The concept is very simple, rather than each project picking the xsd (any other file) from there project's 'xsd' folder, pick it from the common/shared folder.

Oracle SOA suite 11G provides Central MDS and Local MDS.
  • Central MDS is present inside the SOA server
  • Local MDS is a folder inside the JDeveloper

*** Ideally all the artifacts should be inside the central MDS.

We will go through step by step creating Central MDS repository for keeping XSD, use them in project and later see how to remove XSD from Central MDS.

Creating Central MDS repository for keeping XSD:

Step1.) Making MDS connection in JDeveloper

a.) Make a Database connection to MDS schema, all the XSD will get saved inside the DEV_MDS schema, this schema gets created when we run RCU.bat file, please run rcu.bat again if you have skipped it while installation.





b.) Create a new MDS connection, this MDS connection is to the Database, set the Connection type as "DB based MDS", this is actually creating MDS in the SOA server which saves all the repository files in the database (DEV_MDS).





We can now browse to the MDS repository and see what are the files inside it, this is the place where where the XSD files will come up.



Step2.) Pick the XSD files from the local system, While doing the JDeveloper installation it create a local MDS for us which is replicated in the central MDS, we will keep the XSD files in the local directory.

Go to this location on local system "Oracle\Middleware\jdeveloper\integration\seed\" and create a new folder in it 'apps' Oracle\Middleware\jdeveloper\integration\seed\apps
and paste all the XSD's you want to move to central MDS.
I have pasted here 'Employee.xsd'



Step3.) Create a simple JAR deployment profile that contains the artifacts,
Create a new SOA project in JDeveloper and select empty composite, double click on the project to go on the properties.





Create a new deployment profile with name "SharedSOACentralMDS" type "JAR File"



Click on contributors and add a new contributor.





Browse for the folder "Oracle\Middleware\jdeveloper\integration\seed\apps"





Now click on Filters to check which all files we want to put on Central MDS, this is the screen where we can decide which files will go inside the MDS



Next, we have to create a deployment profile of the type SOA Bundle at the level of the composite application.





Create a new deployment profile of type "SOA Bundle" and go on dependencies





Step4.) Deployment













Deployment success





** If you want to use some other folder other then apps then we can add that inside Jdev adf-config.xml

Add the folder location and inside that a seed folder.




Browse through the MDS connection we created in JDeveloper



Using files from MDS in project

Create a new BPEL process by dropping a BPEL process on composite.xml



For the input and output of this process we will refer to the XSD present in the central MDS.



Un-check the option for "copy to project" to use it from MDS and take a look at the URL "oramds:/apps/Employee.xsd"





Repeat the same for output variable too.

Now we will go inside the WSDL file and check what is the difference, instead of picking it from the xsd folder it is using "oramds:/apps/Employee.xsd" and picking it from the MDS



Deleting files from MDS

We can use Weblogic scripting tool (WLST) to delete this folder from MDS,
double click "wlst.cmd" inside C:\Oracle\Middleware\Oracle_SOA1\common\bin to start





Thursday, June 23, 2011

Oracle Image processing and Oracle BI

Hi,

Last weekend I went to Oracle conference, there were 2 interesting things which I came to know.

1.) Oracle Image and process management, This comes under Oracle Fusion Middleware and the interesting thing about this is, it can read documents and process that data, its like you scan a form which is filled in for a patient in the hospital, and it will automatically convert all this data which can be feed to any system, there is no need of a person who will manually enter all this, the data can also be converted to other format.

2.) Oracle BI, now BI can be integrated with SOA as the BI can be exposed as a service.

Both of the above things are very usefull for Oracle SOA and can be used in various projects for integration.

How to Change input and output for BPEL process

How to change the input and output of a BPEL process

It’s quit possible that once we have created a BPEL process with some input and output and in future we want to change then for that process. Here is a simple “HelloWorld” BPEL example to demonstrate how we can change the input and output of that BPEL process.

Step 1.) We can use Assign activity "copy operation" to check the structure of input and output of the BPEL process




Now we will change the input and output of this BPEL process to some other XSD. This is the Math.xsd and our task is to use this in our BPEL process for input/output





Step 2.) Go inside composite.xml and remove the wire between client and the BPEL and also remove the webservice binding (left side)



Step 3.) From the component panel drop a web service adapter on the Exposed Services (left side) of the composite.xml and name it as MathWS and click on the icon for generating the WSDL from the Math.xsd schema.





Browse the schema and select the request element from Math.xsd. If we want to give namespace for this WSDL file we can do it on the same screen, this WSDL getting created which will be exposed to outside world. For output variable and fault we can repeat the same steps.

Now we can see that the new web service MathWS is in place



Step 4.) Before joining the wire to BPEL process we need one more thing, go inside the BPEL process and remove the old client which was for HelloWorld,



Delete both the wire for request and reply and then the web service.




Step 5.)
Now go inside the BPEL process and click on the “X” this will open up the Variables screen, double click the variable we want to change, in our case we are changing both input and output,





On the edit variable screen we see three different types,

  • Simple Type, this will give us standard variable type like, String, Integer, long, double etc.
  • Message Type allows us to select variables from partner links (used in the process) or any WSDL file
  • Element Type allows us to select variables from XML schema files (XSD)
We want to get the input and output from the MathWS so we can browse the message type and select the input from the partner link MathWS and repeat the same for output variable also.

Step 6.) Now join the wire between web service and the BPEL process in composite.xml




Inside the BPEL process we will see this Math web service



We can now join the wires for receive and reply




Thursday, May 5, 2011

Calling one BPEL process from another

A simple example of "Calling one BPEL process from another in a composite"

Step1.) Inside the composite drop a BPEL process this is the BPEL process which we want to call "BPELProcess1", uncheck 'expose as a SOAP service'





Step2.) Open the BPELProcess1 and drop a 'assign' activity in between.



Step3.) Open the 'assign' activity and concat() the input string with "Hello!!!"





Step4.) Now drop a new BPELProcess2, this will call "BPELProcess1" expose this process as SOAP Service,





Step5.) Join wires of BPELProcess2 with BPELProcess1



Step6.) Open "BPELProcess2", here we can see the BPELProcess1 as partner link



Step7.) Invoke BPELProcess1 from inside BPELProcess2







Step8.) Map the input of BPELProcess2 with the invoke activity input variable and also the output variable of invoke activity with the output of BPELProcess2







Step9.)Deploy the Composite



Step10.) Test