Thursday, 29 March 2012

Exporting the SOA MDS

A cool feature from SOA 11g Enterprise Manager is manageing the MDS. You can export and import the MDS to the file system.
SOA-Infra -> Administration -> MDS Configuration
Select Export and point to a directory, on the server, in which EM is able to write
After you press OK, it will take a while, depending on the size of your MDS, when it is finished/
When you have export the data into a location on the server you can view it off course. It will contain the shared objects of the SOA 11g; Fault Policies, XML Schemas etc. But it also contains the complete SOA 11g configuration of all the settings;  
  • Composite properties
  • BPEL  properties
  • Mediator properties
  • Workflow  properties
  • Rule  properties



Sunday, 25 March 2012

Oracle SOA Suite 11g –different user roles to restrict the access of EM console

Different user roles to restrict the access of EM console:
Not like oracle SOA Suite 10g, Oracle SOA 11g is having different roles to restrict the access of the EM console.
Refer the below URL for the details about user roles for EM console.


Access to the Enterprise Manager console is determined by the role assigned to the user.
The steps to configure the different EM console roles to the user.
Through EM console
1. Create the corresponding users through weblogic console
2. Now log in to the Enterprise Manager console with admin privileges. Under SOA folder right-click on soa-infra and select Security -> Application Roles.

          3. Click on the search button without entering the role name. This will list of all Application Roles.
          4. Click on the corresponding role.
          5. Scroll down and click on add user. Click on the search button, this will list all the available users.   Select the user from left side (Selected Users) and move to Right(Available Users) and click OK.
Through WLST
The below WLST script can be used to assign the different EM console roles to the user.

grantAppRole(appStripe="soa-infra",appRoleName=roleName, principalClass="weblogic.security.principal.WLSUserImpl", principalName=userName)
This will assign the specified roles to the specified uses.



               
                                             
          







Friday, 23 March 2012

Dynamically passing the file name to read adapter using sync read with same format but with different names



Sync Read option in BPEL file adapter allows us to read the file from the middle of the process, this is different from the Read option which polls for the new files and is the start of the BPEL process.
As we design the file adapter for sync read it asks for the file name which is static, this means that only file with this given name will be read. Now suppose if we need to read files having same format but different names. How are we going to do that?
I found this question posted on the oracle forums http://forums.oracle.com/forums/thread.jspa?threadID=935976&start=0&tstart=0 
There's a simple way to do this. Whenever we create an adapter a fileAadapterOutboundHeader.wsdl file is created. If we open this file we'll find an inline schema having the fileName element. Below is the fileAadapterOutboundHeader.wsdl file:
<definitions
name="fileAdapter"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/"
xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/file/"
xmlns="http://schemas.xmlsoap.org/wsdl/" >
<types>
<schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:FILEAPP="http://xmlns.oracle.com/pcbpel/adapter/file/">
<element name="OutboundFileHeaderType">
<complexType>
<sequence>
<element name="fileName" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- Header Message -->
<message name="OutboundHeader_msg">
<part element="tns:OutboundFileHeaderType" name="outboundHeader"/>
</message>
</definitions>
Procedure:
While invoking the adapter we only need to set this fileName element with some dynamic generated value. Below are the steps to do this:
  1. Double click the invoke activity which invokes the sync read adapter.
  2. Go to adapters tab and click the torch icon.

     3. Click on Variables and create a new variable.

     4. Give some name like OutboundheaderVariable, choose message type and click the torch. 
    5. Drill down to fileAadapterOutboundHeader.wsdl > Message Types and select OutboundHeader_msg. Click    Ok till you are back in the diagram. 
     6. Place an assign activity above this invoke and copy the file name to the OutboundHeaderVariable >fileName variable.
That's it.
Now we can give the name of the file at runtime as the input parameter or we can define deployment descriptor to give the file name.









Sunday, 18 March 2012

How to create DB DataSource and JNDI Name


Why to Create DataSource and JNDI Name:- JNDI name is the referenece to the repository or registry where the database connection detail and physical server address is present.

How to Create DataSource and JNDI Name:- To create a data source:
1. Navigate to http://servername:portnumber/console.
2. Use the required credentials to open the Home page.
3. Under Domain Structure, select Services then click Data Sources.
The Summary of JDBC Data Sources page is displayed.
4. Click New and then Generic Data Store. The Create a New JDBC Data Source page is displayed.
5. Enter the following values for the properties to be used to identify your new JDBC
data source: ■ Name: demoDatabase■ JNDI Name: jdbc/demoDatabase■ Database Type: Oracle  
6. Retain the default value for Database driver in next  page
7. Click Next. The Create a New JDBC Data Source Transaction Options page is
displayed.
8. Click Next. The Create a New JDBC Data Source Connection Properties page is
displayed. Enter the database  connection properties in the Connection Properties page, and then click
Next.
The Create a New JDBC Data Source Test Database Connection page is displayed.
9. Click Test Configuration to test the database availability and the connection
properties you provided. A message stating that the Connection test succeeded is
displayed at the top of the Create a New JDBC Data Source Test Database
Connection page.
10. Click Next. The Create a New JDBC Data Source Select Targets page is displayed.
11. Select a target, and then click Finish. You have created a data source.
The Summary of JDBC Data Sources page is displayed. This page summarizes the
All changes have been activated. No restarted required for the changes to take effect

Creating a Connection Pool:-
1. Under Domain Structure, click Deployments.The Summary of Deployments page is displayed.
2. Click the DbAdapter name from the Deployments list.
The Settings for DbAdapter  page is displayed.
3. Click Configuration tab, and then click Outbound Connection Pools tab.
The Outbound Connection Pool Configuration Table is displayed.

4. Click New.
5. Select javax.resource.cci.ConnectionFactory, and then click Next.
The Create a New Outbound Connection page is displayed.
6. In the JNDI Name: field, enter eis/DB/demoDatabase. Then click Finish.
The JNDI name specified in this step must match the value with database connection that need to create in jDeveloper.
7. Click on the newly created OutboundConnection.In the Properties field, enter the value for xADataSourceName as jdbc/demoDatabase which was created previously. press Enter in the
keyboard to save the changes.
8 Under Domain Structure, click Deployments.The Summary of Deployments is displayed.
9 Do either of the following steps:
a. Select the DbAdapter check box, and then click Update.The Update Application Assistant page is displayed.
b. Select Redeploy this application, and then click Finish.
Adding  a new value for the outbound connection pool, then no re-start required for the Managed server or the Admin server. However, editing is done on any property of an existing connection pool, then re-start of the server  is required








Saturday, 17 March 2012

Converting Synchronous bpel process to Asynchronous bpel process

Hi all, this article is about how to convert a synchronous BPEL process to an asynchronous one.
Whenever we create new bpel process three files are created by default viz.
  • [processName].bpel
  • [processName].wsdl
  • bpel.xml
But the difference between the Synchronous and Asynchronous process remains in the .bpel and .wsdl files only.
If we open the .bpel and .wsdl file of both the processes we do not find much difference in the two therefore it's very easy to convert an asynchronous process to synchronous one and vice-versa.
For explaining how to convert the synchronous process to asynchronous one I have created a BPELprocess SynchBP. I’ll be converting SynchBP which is a Synchronous BPEL process to an asynchronous one. As earlier said the difference is only in .bpel and .wsdl file so we'll concentrate only on these two files.
For ease of understanding I have used colours in the text so as to highlight what to change and what to add.
So, first start with SynchBP.bpel file.
There are three places where we have to make changes viz. partnerlink, receive, and reply element.
Partnerlink:
This is how the partnerlink element is of a SynchBP:
<partnerLinkname="client" partnerLinkType="client:SynchBP" myRole="SynchBPProvider"/>
Add another attribute partnerRole="SynchBPRequester" to this element. The partnerlink will look like this:
<partnerLink name="client" partnerLinkType="client:SynchBP" myRole="SynchBPProvider"partnerRole="SynchBPRequester"/>
Receive Element:
 Below is the receive element of SynchBP
   <receive name="receiveInput" partnerLink="client" portType="client:SynchBP" operation="process"variable="inputVariable"
 createInstance="yes"/>
 Change the value of attribute operation from process to initiate. The partnerlink will look like this:
<receive name="receiveInput" partnerLink="client" portType="client:SynchBP" operation="initiate"variable="inputVariable" createInstance="yes"/>
Reply element:
 Below is the reply element of SynchBP
<reply name="replyOutput" partnerLink="client" portType="client:SynchBP" operation="process"variable="outputVariable"/>
 Do the following changes to make it for asynchronous process:
  • Change the element name from reply to invoke.
  • Change the name attribute value from replyOutput to callbackClient.
  • Change the value of attribute portType from client:SynchBP to client:SynchBPCallback (or simply[processName]Callback ).
  • Change operation=”process” to operation=”onResult”.
  • Change the name of last attribute i.e. variable to inputvariable.
<invokename="callbackClient" partnerLink="client" portType="client:SynchBPCallback"operation="onResult" inputVariable="outputVariable"/>
Here we are done with SynchBP.bpel, now we need to edit SynchBP.wsdl.
There are very few changes to be made in the .wsdl file.
The elements that need to be changed are portType and partnerLinkType.
portType:
This is how a portType is defined in a synchronous process:
<portType name="SynchBP">
 <operation name="process">
   <input message="client:SynchBPRequestMessage" />
   <output message="client:SynchBPResponseMessage"/>
</operation>
</portType>
Create another portType element with name SynchronousProcessCallback and operation as onResult.Now delete the output element from both portTypes and in the SynchronousProcessCallback portType, change the attribute value from client:SynchBPRequestMessage to client:SynchBPResponseMessage. (Help: Copy & paste the already defined portType and do as below)
<portType name="SynchBP">
<operation name="initiate">
<input message="client:SynchBPRequestMessage" />
<output message="client:SynchBPResponseMessage"/> ……Remove this
</operation>
</portType>
<portType name="SynchBPCallback">
<operation name="onResult">
<input message="client:SynchBPRequestMessage"/>……. Remove this
<input message="client:SynchBPResponseMessage"/>
</operation>
</portType>
partnerLinkType: 
This is how partnerlink information is provided in a wsdl of a synchronous process:
<plnk:partnerLinkType name="SynchBP">
 <plnk:role name="SynchBPProvider">
   <plnk:portType name="client:SynchBP"/>
 </plnk:role>
</plnk:partnerLinkType>
Inside partnerLinkType create one more role element and give it a name asSynchronousProcessRequester. Now inside the role element for portType element change the value of name attribute to client:SynchronousProcessCallback.
<plnk:partnerLinkType name="SynchBP">
 <plnk:role name="SynchBPProvider">
   <plnk:portType name="client:SynchBP"/>
 </plnk:role>
 <plnk:role name="SynchBPRequester">
   <plnk:portType name="client:SynchBPCallback"/>
 </plnk:role>
</plnk:partnerLinkType>
Here we are done with .wsdl file and the SynchBP process is now an asynchronous BPEL Process.