Wednesday, 29 February 2012

Having Confusion around Fusion!!!

Question: What will be my role as Oracle Fusion Developer?

Answer: As a Fusion Developer role you would be playing a very important role in the next generation Applications that customers will be embarking on. It's a paradigm shift from current approach to a process centric approach. Typically in a Fusion project there will be necessity to extend or integrate the functionality with a process centric approach with existing applications (Oracle, Siebel, PeopleSoft , or otherwise) via J2EE/ADF and Oracle SOA—or building new components on the Oracle Fusion Middleware stack. As a Fusion Developer you would building those components on Fusion Stack and Deploy them in Fusion Middleware.

Question: Please let me know the difference between Fusion Architecture, Fusion Middleware and Fusion Applications.

Answer: Fusion Middleware - Middleware infrastructure services that can be used to build and deploy applications.
Fusion Applications - Oracle's next generation applications suite, built on top of Fusion Middleware using Fusion Architecture as blueprint



Fusion Architecture is a reference architecture or blueprint for building applications. It can be referred to as the Enterprise Architecture Platform of Oracle.

Fusion Middleware / 10g Application Server Overview


Industry has started talking about Fusion Middleware & Oracle recently certified 10g Application Server (Portal 10.1.4) with Oracle E-Business Suite so I am discussing overview of Application Server part of Fusion Middleware Family.
Overview of 10g Application Server
10g Application Server Consist of Infrastructure Tier & Middle Tier
What is Infrastructure Tier ?
Infrastructure Tier provides Infrastructure Services to 10g Application Server & consist of following technical components
Database -> To Store User/Applications Identity Data (Portal,Wireless,OID data)
OID -> Oracle Internet Directory, to store User Credentials, Schema passwords, Application details & lot more …
HTTP Server -> This Web Server (OHS, Oracle HTTP Server) on Infra Tier is used to access SSO (Single Sign-On Server) & OIDDAS (OID Delegated Administrative Services)
OC4J -> Oracle Container for J2EE (OC4J_Security for SSO), You have additional OC4J_OCA if you have OCA (Oracle Certifying Autority). OCA is Optional component in Infrastructure Tier
What is Middle Tier ?
Middle Tier is tier where application Server & applications logic resides. It consist of following Technical Components
HTTP Server -> This OHS (Oracle HTTP Server) is separate from above OHS & this is OHS from where users access application Server like portal, wireless, j2ee
OC4J -> These are container which provide place holder for j2ee or web applications . Applications are deployed on OC4J’s. 10g AS comes with default OC4J name “home“, you create more OC4J depending on your requirement
Web Cache -> Web Cache acts as cache for fast response to web server.
Logical Services for Infrastructure Tier
Above was technical components of Infrastructure Tier , Logically Infrastructure Tier consist of Two main categories which are
Identity Management 

Metadata Repository
What is Metadata Repository ?
MR is similar to Database Metadata & MR you can further classify as
Metadata repository for Products (Like Portal, Wireless, BI) This MR usually is user data. Lets assume I created some pages, documents in Portal or User entered some data in any application , such data when stored in database is called as Product MR
MR for OID - Oracle Internet Directory contain some data & data related to this , one can classify as MR for IM (as OID is part of Identity Management - discussed later)
MR for SSO - Oracle Single Sign-On data & schema definitions , one can classify as MR for IM (as SSO is part of IM)
So broadly there are three kind of MR (that’s how I classify MR)
What is Identity Management ?
Logical Grouping of Services which help in Managing Identity is called as Identity Management.
Identity management Consist of following Services like (Discussed later in Detail)
OID Oracle Internet Directory
DAS Delegated Administrative Services
DIP Directory Integration & Provisioning Services
SSO Single Sign-On Service
OCA Oracle Certifying Authority



Thursday, 2 February 2012

Configuring Email notification in Oracle SOA 11g


Sending email notification in Oracle SOA Suite 11g using gmail 


In this post, we are going to see how to send emails in Oracle SOA Suite 11g. Instead of using a local email server, we are going to use Gmail for this purpose. If you do not have a Gmail account, now is the time to create one as you are going to need it very soon.


  I am using Oracle SOA suite 11.1.1.5.If you are using a slightly older version, don't worry because the steps are going to be same.So let us get started straight away.Start the weblogic server and the SOA server.Next login to the Enterprise Manger Console.For me, it is available at:

 http://localhost:7001/em

Next, expand the "User Messaging Service" node in the left pane.Next right click on the "usermessagindriver-emai(soa_server1)" node and select the "Email Driver Properties" option from the context menu.






The email driver properties page should open up.We will be setting the following values in this page:-



  • OutgoingMailServer
  • OutGoingMailServerPort
  • OutGoingMailServerSecurity
  • OutGoingUsername
  • OutGoingPassword
We are going to use Gmail for sending mails.So, enter "smtp.gmail.com" as the value for "OutgoingMailServer".

Enter the value "465" for the "OutGoingMailServerPort" property.

Select the "SSL" option from the drop down for the property "OutGoingMailServerSecurity".

Enter the account username for the property "OutGoingUserName".

For the property "OutGoingPassword", select the "Use Cleartext Password" option from the "Type of Password" drop down and enter the password for the account.



Hit the "Apply" button on the top right corner of the page to apply the changes.A message will be displayed at the top of the page saying that the values has been updated successfully.



If you want to use any other popular mail provider, you can get the details from the following link:-


In this case, enter the values according to the vendor you choose.Next, restart the SOA server.

Our next step is to obtain and install the security certificates for Gmail into our JRE.For this, we are going to use "OpenSSL" to obtain the certificate.You can download "OpenSSL" from the following link:-

                        http://gnuwin32.sourceforge.net/packages/openssl.htm

Download and install "OpenSSL".The path I installed it in is "C:\openssl".From now on, this is referred to as OPENSSL_HOME. To launch "OpenSSL", go to OPENSSL_HOME\bin.Then double click on the file "openssl.exe" to launch it.A new command prompt will open with "OpenSSL" prompt.


 Make sure you are connected to the internet.Next, type in the following command hit enter in the "OpenSSL" console:-

              s_client -connect smtp.gmail.com:465

 The certificate will be output on the console itself. Copy the portion from the "BEGIN CERTIFICATE" to the "END CERTIFICATE' as indicated in the image below:-



 Open your favourite text editor, paste the copied string and save the file with the name "gmail.cert". You can use whatever name you want.Just make sure the extension of the file is ".cert".

  Next, back in the "OpenSSL" console, hit "CTRL+C". Then type in the following command and hit return:-

                 s_client -connect imap.gmail.com:993


Like before, copy the portion from the "BEGIN CERTIFICATE" to the "END CERTIFICATE".This time save it in a file named "gmail_imap.cert".

In the previous step, we got hold of the certificates.Next, we are going to install these certificate into our JRE.Open a new command prompt.Next, issue the following command and hit return.

keytool -import -alias smtpgmail -keystore my-trusted-certificates.jks -file C:\gmail.cert


Adjust the command according to the file location of the "gmail.cert". You will be prompted for setting up a password for the first time.Enter "changeit".The certificate will be added.

Similarly, issue the following command to add the "gmail_imap.cert" file to the key store.

keytool -import -alias imapgmail -keystore my-trusted-certificates.jks -file C:\gmail_imap.cert


After executing the commands, a new ".jks" file named "my-trusted-certificates.jks" will be create in the directory where you executed the commands from.


Now, go to SOA_HOME/user_projects/domains/domain1/bin(e.g. D:\Oracle\Middleware\user_projects\domains\domain1\bin).

Next ,edit the setDomainEnv.cmd file and replace the existing javax.net.ssl.trustStore property setting with :-

Djavax.net.ssl.trustStore=D:\Oracle\Middleware\jdk160_18\jre\bin\my-trusted-certificates.jks 

 and


 -Djavax.net.ssl.trustStorePassword=changeit

Adjust the location of the ".jks" file and the password according to your system.Restart the server once again.We are all set to go now.


Open JDeveloper if it is not already open.Next go to File->New.


In the "New Gallery", select the "Applications" node under the "General" node.In the right pane, select the "SOA Application" option and hit OK.


In the "Create SOA Application" window, enter a name for the application.To follow along, enter "GmailNotificationApp".Hit next once you are done.




In the next screen, enter a project name.To follow along, enter "GmailNotificationProject".Hit next once you are done.



In the next screen, select the "Composite With BPEL Process" option and hit finish.




Your project will be created.Next, the "Create BPEL Process" window will pop up.Enter a name for the BPEL process.To follow along, name "GmailNotifierProcess".Select the "One Way BPEL Process" template.Make sure you check the "Expose as a SOAP service" option.Hit OK once you are done.You can use the following image as a guide.



Your composite will look like the following image.



Double click on the BPEL process to open it.Next, drag and drop an email activity from the component palette and put it just below the receive activity.



Next, double click on the "email" activity.Under the "General" tab, enter the values.First, click on the expression builder button just beside "To" to bring up the expression builder.



In the expression builder, select the "input" variable under the "inputVariable" node and click on the "Insert Into Expression" button as indicated in the image below.Hit OK once you are done.



Back in the "Email" activity configuration screen, enter a value for the "Subject" and "Body".You can use expressions for these values also.Hit OK once you are done.Click on "Save All" to save the changes.



Our application is complete.You can deploy and test the application.Make sure you are connected to the internet.In the Enterprise Manager console, enter the email address where you want to send the email as the input and test the service.

Finally..Enjoy with SOA 11g...!!!

Configuring FTPAdapter in Oracle SOA 11g


Configuring FTP adapter in oracle SOA suite 11g:


In this post, we are going to see how to user FTP adapters in Oracle SOA Suite 11g.We will also see how to configure a single FTP adapter for multiple hosts.Without further ado, let us get started.

First, we are going to install and configure an FTP server locally.I am going to use FilleZilla.You can download the FileZilla Server from :

                               http://filezilla-project.org/download.php?type=server


Download and install the program.When first time you run the program, a screen like the following image pops up.

Accept the defaults and hit OK.Next, we are going to add a user.To do this, click on the add user icon as indicated in the image below:-



On the "Page" pane on the left, select the "General" node.Next click on the "Add" button to add a user :-



Next, in the "Add user account" window that pops up, enter a name for the user account.To follow along, enter "user".Leave the other defaults and hit OK.



Notice that the user has been added to the list of users.Click on the password checkbox and enter a password for your account.To follow along, enter 'password1$'.



Next, click on the "Shared folders" node under the page pane.



Hit the "Add" button under the "Shared Folders" pane as indicated in the image below:



In the "Browse for Folder" window, select a location.To follow along, select "C:\temp".



Back in the "Users" window, make sure you check the "Write" check box to provide write permission.


Hit OK once you are done.



In the next step, we are going to configure an outbound connection pool in the weblogic FtpAdapter application.This is necessary to make this whole thing work.First start up the weblogic admin server and the managed SOA server.Next go to the weblogic console.Next click on the "Deployments" link as indicated in the image below:-



On the deployments page, click on the "FtpAdapter"  application.(You may not see the adapter on the first page of the list.In this case, click on the "next" link on the top right to navigate through the pages until you see it).



In the next page, select the "Configuration" tab and then under "Configuration" tab, select the "Outbound Connection Pool" tab.



Next click on the new button as indicated in the image below:-



On the next screen, select the "javax.resource.cci.ConnectionFactory"  radio button and hit next.




In the next screen enter a JNDI name of your choice.To follow along, enter "eis/Ftp/test".Make a note of this JNDI as we will be needing it not too far from now.Hit the "Finish" button once you are done.



This will get you back to the "Outbound Connection Pool Configuration Table" page.Expand the "javax.resource.cci.ConnectionFactory" node.You will be able to see the the JNDI of the connection factory that we just created.




Click on the connection factory to configure the properties.We are going to set the following properties:-

                              host
                              port
                              username
                              password

You will not see all the properties in the same page.To locate them, you will have to navigate through the list by clicking on the Next and Previous buttons at top-right or bottom right of the table.



To set the properties, you must follow the following steps in sequence:-

                a. Locate the pertinent property.
                b. Click on the particular cell for that property under the "Property Value" column.
                c. Type in the value and hit Enter.

Following these steps, locate the "Host" property and set the value to "localhost".Set the "port" to "21".Set username to "user" and password to "password1$".Hit the save button once you are done.



Next click on the "Deployments" link to go back to the "Deployments" page.In the "Deployments" page, select the checkbox next to the "FtpAdapter" application and click on the "Update" button as indicated in the image below.




In the page that appears next, accept the defaults and click on the finish button.


If everything goes right, a success message is going to be displayed on top of the screen.



This completes our configuration for the "FtpAdapter".

Next, open JDeveloper.I am using JDeveloper 11.1.1.5.If you are using an older sub-version, dont't worry because the steps are going to be the same.

First, click on File and select the new option



In the "New Gallery" , select the "Applications" node under "General" tab in the left pane and on the right pane, select the "SOA Application" option.Hit "OK" once you are done.



In the next screen, enter a suitable name for the application.To follow along, enter "FTPTest".Hit next once you are done.



In the next screen, enter a suitable name for the project.To follow along, enter "FTPAdapterDemo".Hit next once you are done.


In the next screen, select the option "Composite with BPEL Process" option and hit "Finish".


The dialog for creating BPEL process will pop up.Enter a suitable name for the BPEL process.To follow along, enter "FTPDemoProcess".Select one-way as the process template.Leave the other defaults as they are.Hit OK once you are done.


The BPEL process is going to be added to the composite and the composite should now look somewhat like the following image:



Next drag and drop a File Adapter from the component palette to the "External References" swim lane.Once you do that, the "FTP Adapter Configuration Wizard" is going to open.Click next on the first screen that appears.




In the next screen that appears, enter a service name.To follow along, enter "FtpAdapterService" as the service name.Hit next once you are done.



In the next screen, select the option "Define from operation and schema (specified later)" option and hit next.



In the next screen, enter the JNDI name of the connection factory that we created previously.If you followed along, that is "eis/Ftp/test".


In the next screen, select the "Put File" operation as we want to write a file.Notice that the operation name is also automatically changed to "Put".Also, select the "Ascii" option as the File Type.Hit next once you are done.


In the next screen, choose the "Physical Path" option and enter "." in the "Directory for Outgoing Files( Physical Path)" text box.Enter a file naming convention.To follow along, enter "test_%SEQ%.text".Leave the other defaults as they are and hit next.



In the next screen, click on the magnifying glass as indicated below to select the schema file.


In the new window that pops up, expand the "Project Schema Files Node" and select the "process" node under the "FTPDemoProcess.xsd" node.Hit OK once you are done.


Back in the "FTP Adapter Configuration Wizard", select next.


In the next screen, hit Finish to complete the creation of the FTP adapter.



The composite should look somewhat like the following image:-



Next, wire the BPEL process with the FTP adapter that we created.


Next, double click on the BPEL process to open it.Next drag and drop an assign activity after the default "Receive" activity.Next drag and drop another "Invoke" activity just after the assign activity.Next, double click on the invoke activity.In the screen that appears, enter a name for the activity.To follow along, enter "InvokeFtpAdapterService".Then click on the magnifying glass as indicated in the image below:




The "Partner Link Chooser" window will pop up.Select the "FtpAdapterService" partner link and hi OK.



Back in the previous screen, click on the green plus icon as indicated in the image below to create the input variable for the invoke activity.


In the "Create Variable" window, select the defaults and click on O

Back in the previous screen, verify the configuration and once you are satisfied, hit OK.



Next double click on the assign activity and select the "General" tab.Enter a name of your choice.To follow along, enter "AssignInput".

 

Next, select the "Copy Rules" tab and create a copy operation from the input variable to the to the input variable of the invoke activity.You can use the following image as a guide.Hit OK once you are done.


The BPEL process should look like the following image:-


Next deploy and test the process.A file should be written in the C:\temp directory.


Configuration to use multiple FTP Hosts:


Think of the scenario that you want to write your files to a different location based on some condition.We can achieve this in the following way:

First configure another connection pool in the outbound connection pool and configure your host.For testing purpose, I configured another user in FileZilla with a different directory location.Then used the username and password of that user to configure another connection factory.The name of the connection factory that I configured is "eis/Ftp/FtpAdapter".I shared the folder "D:\ftp" for this user.

Now, open the BPEL process and create a new global variable by clicking on the create variable icon as indicated in the image below:-



In the window that pops up, click on the green plus icon as indicated in the image below:-



In the create variable window,enter a name for the variable.To follow along enter "connFactory".Next, click on the magnifying glass beside the Type to select the type of the variable.




In the "Type Chooser" window, select string and hit OK.




Hit OK two times to complete the creation of the window.

Next, go to the source of the BPEL process by clicking on the source tab at the bottom:-


Next, modify the code for the invoke activity by specifying a reserved header property :- jca.jndi in the following way.



 <invoke name="Invoke_FtpAdapterService" bpelx:invokeAsDetail="no"
            inputVariable="Invoke_FtpAdapterService_Put_InputVariable"
            partnerLink="FtpAdapterService" portType="ns1:Put_ptt"
            operation="Put">
            
          <bpelx:inputProperty name="jca.jndi" variable="connFactory"/>  
           
    </invoke>



What this basically does is that it specifies the JNDI name of the connection factory to use at run time.

Now, go back to the Design view of  the BPEL process by clicking on the "Design" tab at the bottom.



Next, drag and drop a switch activity onto the BPEL process just after the assign activity.The BPEL process should look like the following image:-

 o
Next, double click on the switch activity.In the window that comes up, enter a name for the switch activity.To follow along, enter "SwitchConnectionFactory".Hit OK once you are done.


Next, click on the <condition> node for the case branch.Enter a label of your choice.To follow along, enter "tempdir".Next open the Expression Builder by clicking on the icon as indicated below:-


In the expression builder, enter the following XPath expression which checks the length of the input.

string-length(bpws:getVariableData('inputVariable','payload','/client:process/client:input'))>10


 Hit OK once you are done.







Next drag and drop an assign activity under the case branch of the switch activity.Drag another assign activity under the otherwise branch.The BPEL process is going to look like the following image.








Double click on the connection factory that is under the case branch.Go to the general tab and enter a name.To follow along, enter "AssignCF".


Click on the "Copy Rules" tag.Next create a copy operation that copies the string "eis/Ftp/test" to the "connFactory" variable.



The assign activity should look like this in JDeveloper 11.1.1.5.


Hit OK once you are done.

Next, double click on the assign activity under the otherwise branch of the switch.Go to the "General" tab and select enter a name.To follow along, enter "AssignCF".Next go back to the "Copy Rules" tab.Create a copy operation that copies the string "eis/Ftp/FtpAdapter" to the variable "connFactory".Hit OK once you are done.



The BPEL process should roughly resemble the following image:-


We are done.Deploy the process and test.If the length of the input is greater than 10 characters, then the file is going to be written in "C:\temp".Otherwise, it is going to be written in "D:\ftp".


Finally ..Enjoy with SOA...!!!