Friday, December 31, 2010

Tutorial 3 : How to Install Oracle SOA Suite 11g -11.1.1.3 Part III - Running Repository Creation Utility

In this tutorial I am going to cover Schema creation in Oracle XE database which is required as a starting step before installing the SOA Suite 11g.

Here in this tutorial we are going to Run Repository Creation Utility provided by Oracle for SOA Suite 11g ( Version 11.1..1.3 ).

Go to the folder where you have downloaded the Repository Creation Utility version 11.1.1.3 ( c:\SOAInstallables as per tutorial I)

Double click the rcu.bat in folder structure similar to ofm_rcu_win_11.1.1.3.0_disk1_1of1\rcuHome\BIN\ and you should see below screen sequence.

1. Welcome Screen



















2.  As we want to create requred schema for installation select create.



















3. Provide the required details 
 Note : username used here is SYS, this should be the user with SYSDBA role











4. Select the Components for which you want to generated schema tables.




















5. Here you can choose to provide single username / password for all schema component or also you do have flexibility to provide username/password for individual components. For development environment use single username/password for all components.



















6.  This screen will allow you to choose different tables spaces for the components. kept it defult and press next.






















7. Summary of all installation is generated at the last. Click close the finish the process.


Wednesday, December 1, 2010

Upgrade Weblogic Server 10.3.2.0 to Weblogic Server 11g (10.3.3.0)

Here in this tutorial we are going to upgrade Oracle Weblogic Server 10.3.2.0 to Weblogic Server 11g i.e. 10.3.3 Version. This is very simple are pretty straight forward process.

If you are upgrading SOA Suite 11g 11.1.1.2 to SOA Suite 11.1.1.3 they you may required this to upgrade you Weblogic Server 10.3.2.0. 

Go to the Program Files and Weblogic Installation and select Smart Update.

This is gona ask you for username and password for Oracle Support as shown in below screen shot. Provide the required information and login,
















Now you should able to see Smart Update Wizard Screen as shown below, go to the Maintanance Packs and select Update.














As shown in below screen select release 10.3.2.0  and in right you should be able to see Weblogic Platform (10.3.3.0) in Upgrade options. Click OK


















This will start Oracle Installer for Weblogic server 10.3.3.0 as shown in below screen. Click Next














Uncheck if you dont want to receive any update from oracle














Select the location where you want to download the installation files.




























Here in below screen you need to specify in which directories you want to install the upgrade. Click Next to start installation process














After successful installation/upgrade you should be able to see below screen.














That's it. you done with the upgrade.

Tutorial 2 : How to Install Oracle SOA Suite 11g (11.1.1.3) Part II - Installing Oracle XE Database

Beginning Oracle Database 11g Administration: From Novice to ProfessionalIn this tutorial, I am going to cover installation for the Oracle database  required for SOA Suite 11g. For developement purpose we are going to use Oracle Express edition of Database i.e. Oracle XE database. This tutorial and screen shots taken all are for Windows operation system but process is more or less similar in other operation systems as well.

This tutorial has to be followed properly and Oracle XE database has to be installed and configured perfectly. For successfull installation of SOA Suite 11g, this Oracle XE database has to be up and running before proceeding further for other tutorials.

If you have not download yet, Get the latest copy from Oracle website at http://www.oracle.com/technetwork/database/express-edition/downloads/index.html and save it to c:\SOAInstallables (This is the same director which we have created in first tutorial of How to Install Oracle SOA Suite 11g.

When you download the Oracle XE database make sure you download the Universal Installer
Oracle Database 10g: The Complete Reference (Osborne ORACLE Press Series)

Note : When you are running Repository creation utility for creating schema in database before installing SOA Suite 11g, you will see warning that the database you are using is too old. you can safely ignore this warning as it applies for production environment.

As you are installing the Oracle XE as database server for SOA Suite 11g installation, It is important to know that what is the version when we say we are using Oracle XE Database. Database version for Oracle XE is 10.2.0.1 and SOA Suite 11g Installation requires actually 10.2.0.4 or higher or 11.1.0.7 or higher. And that is the reason we are getting the warning while running the Repository Creation Utility before installing SOA Suite 11g. Oracle XE is very good choice for small footprint database in SOA Suite 11g development environment.


Ok, Now you are ready to start with the installation of Oracle XE database for seting up SOA Suite 11g development environment.

Step 1 : Go to c:\SOAInstallables directory and click on OracleXEUniv.exe and It will start the Installation wizard as below. Click Next to proceed




















Step 2: As shown in below screen shot select "I accept" and click Next


















Step 3 : Specify the location where you want to install Oracle 10g Express Edition server and click next.




















Step 4 : specify the password for the SYS and SYSTEM
user account for this database



















Step 5 : Reviw the setting and click on Install




















Step 6 :  Wizard will start installing and copying files



















Step 7 : Click on Finish



































Step 8 : Go to this URL http://127.0.0.1:8080/apex/ and login using SYS and password you have specified for the SYS and SYSTEM user accounts while creating database.  You will be able to see four icons
  • Administration
  • Object browser
  • SQL
  • Utilities
You won't need Oracle client here, all can be done from this User Interface.



Tutorial 1 : How to Install Oracle SOA Suite 11g (11.1.1.3) Part I

Oracle SOA Suite 11g is consists of multiple oracle products and hence it requires to install and configure each of those products in particular sequence to make it work.

Here in this tutorial, I am going to list all the products you will require to install for Oracle SOA Suite 11g (11.1.1.3) and what are the requirement for those products to work correctly. And in next subsequent tutorials I am going to cover each product installation one by one. Below is the list of Tutorials and I am going update this post as and when I am ready with subsequent product installation tutorials.

Tutorial 2 : Installing Oracle 10g Express Edition database
Tutorial 3 : Creating repository using Repository Creation Utility ( version 11.1.1.3)

Memory Requirements : 

To install Oracle SOA Suite 11g, you will required atleast total around 12 GB of memory space including installable files, else you may need to seperate out your installation of SOA Server, Weblogic Server, JDeveloper and Database server separately on different machines.

Download Installable Files :
Download all below files and store it at particular location on local machine say c:\SOAInstallables
Go to the http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html and download required software.

We are going to install SOA Suite 11g (11.1.1.3) and all the products needs to be install for setting up SOA Suite 11g (11.1.1.3) are listed at http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html.
  • Database 
    If you don't already have an Oracle database installed, choose Oracle Express Edition for a small footprint database. (Oracle XE is suitable for development only. Ignore the warning during installation about the database version as that pertains to production installations.)
  • WebLogic Server
    Download WebLogic Server 10.3.3.from the FMW download page, in the Runtime Software section
  • Repository Creation Utility
    Download RCU 11.1.1.3.0 from the FMW download page, in the Required Additional Software section.
  • SOA Suite & Patch
    Download SOA Suite 11.1.1.2.0 from the FMW download page, in the Runtime Software section.
    Download SOA Suite 11.1.1.3.0 (patch) from the FMW download page, in the Runtime Software section.
  • JDeveloper
    Download JDeveloper 11.1.1.3.0 from the FMW download page. Look for JDeveloper and Application Development Framework in the Required Addition Software section.
  • SOA Extension for JDeveloper
    Install the SOA Extension using the JDeveloper Update Center. From the JDeveloper menu choose Help > Check for Updates. In the Update Wizard, select Search Update Centers and ensure Oracle Fusion Middleware Products is checked ( screenshot). Then ensure that Oracle SOA Composite Editor is checked ( screenshot, your version may not match the screenshot exactly). The SOA Extension is approximately 200 MB.

Overall process installation map will be something similar to below.
Image from Oracle.com

Friday, November 26, 2010

Difference & New features in Oracle Service Bus 11g

  1. Service Result Cache with Coherence :
    • Oracle Coherence 3.5
    • Oracle Service Bus now supports service result caching for business services with Coherence. Oracle Coherence is an in-memory data grid solution that lets organizations predictably scale mission-critical applications by providing fast access to frequently used data.
      Service result caching allows caching the response from a business service. This can dramatically improve performance if the response from the business service is relatively static. Oracle Service Bus uses a single cache for all business services. Only valid/correct results from business services are cached.
       
  2. Transaction :
    • With Oracle Service Bus, you can configure a proxy service to start and execute its message flow in the context of a JTA global transaction for non-transactional inbound transports (such as HTTP and JMS with a non-XA connection factory). In prior releases, the proxy service message flow executed in the context of a JTA global transaction only when the inbound transport started/propagated a global transaction (such as JMS/XA or SB with the transaction propagated).
    • With Oracle Service Bus, it is possible to execute both the request and the response pipelines in the context of the same JTA global transaction for non-synchronous inbound endpoints as well. 
  3. JMS Object Message :
    • In Oracle Service Bus, the JMS transport is enhanced to receive and send Java Objects to and from JMS queues/topics. The support is enabled by configuring a proxy or business service to have the Service Type Messaging:Java.
  4. JCA Adapters :
    • Oracle Service Bus provides support for Oracle SOA Suite 11g Release1 Patch Set 2 (11.1.1.3.0) JCA adapter artifacts. New Oracle Service Bus resource types for JCA Bindings and TopLink/EclipseLink mapping XML files are now available, as is support for normalized message properties in the transport headers. Upgrade for Oracle Service Bus 10g Release 3 JCA artifacts is seamless.
      Certification for File and BAM adapters has also been added. Automatic upgrade of Oracle Service Bus 10g Release 3 services using JCA adapter artifacts based on Oracle SOA Suite/JDeveloper 10g Release 3 is provided.
  5. New Transport : 
    •  Newly introduced JEJB transport for invoking EJB 3.0. 
    • It also support exposing proxy service as EJB 3.0 stateless session bean.
  6. Split Join Enhancements :
    • Transaction Support : can execute within context of JTA transaction
    • Wait : can halt execution of branch for specified duration
  7. Transport Enhancements :
    1. JMS Failover For Request/Response Pair : For both Correlation ID and Message patterns, Oracle Service bus provides enhanced high availability by letting you specify a response URI  ( any service account ) for each request URI in request/response JMS Business Service.
    2. Email Load Balancing : Oracle Service Bus 11g lets you specify multiple endpoint URLs for load balancing.

Saturday, September 18, 2010

How to encrypt & decrypt messages for Security : AES (Advance Encryption Algorithm) Cryptography Algorithm Implementation

What is AES ?
Introduction to Modern Cryptography: Principles and Protocols (Chapman & Hall/CRC Cryptography and Network Security Series)AES stands for Advance Encryption Algorithm. AES is a standard of private key or symmetric algorithm.

How To Use This Custom AES Encryption & Decryption with Oracle Service Bus 10g or 11g. ?
Extract the String from any Input Message, let say XML Message, you can easily do so by using XPath expression.

Applied Cryptography: Protocols, Algorithms, and Source Code in C, Second EditionPass this value to Java Callout Action in Oracle Service Bus Message Flow. For AES Encryption and decryption we are going to use Key and Initial Vector. This Key  and Initial vector can be stored in domain path so that it can be made configurable.

Below example shows how to create a Java Class for AES Encryption & Decryption which can be used with Oracle Service Bus 10g/11g to encrypt & decrypt messages. Method you want to call from Oracle Service Bus should be declared as public static. Only Public static methods are available to Oracle Service Bus using Java Callout. After Java Callout you can save the output of the call to any variable inside Service Bus.

Cryptography Engineering: Design Principles and Practical ApplicationsAdvantage : After transport level security it also necessary that once message is delivered to the destination, that Message's important fields need to be secured while getting processed in Destination. And Encrypting those field could be one of the solution and easy to implement if you have little understanding & knowledge about AES Encryption & Decryption Cryptography.

AES Support In Java Technology
In java to support AES, Its has been provided as JCE in starting with Java2 SDK Standard edition (J2SE) v 1.4.0. Java Cryptography Extension (JCE) was integrated with  SDK and JRE and since then its not required to install JCE as a separate package.

AES supports combination of keys and block sizes. AES can support 128 , 192 and 256 block sizes.

128 block size - Secure

Understanding Cryptography: A Textbook for Students and Practitioners192 block size - More secure

256 block size - Most Secure

Following examples shows how to use AES Encryption and decryption. This program shows example of AES Cryptography implementation in Java. To implement & run this program you will require to have Jdk 1.4 or higher version.

import java.math.BigInteger;

The Code Book: The Science of Secrecy from Ancient Egypt to Quantum Cryptographyimport javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/* This class provides a sample example on how to use key and initial vector to encrypt and decrypt String *values  using AES Cryptography Algorithm
*/

public class AES4 {

    public static void main(String args[])
    {
           getAESEncryptedString("SampleStringTobeEncrypted","ddafXA1afcf6b1cb","a33dc00670g13ed7");
    }


/* This method takes string value and returns encrypted string back.
* @param passwordAsString This is string argument which we want to encrypt , values could be some *password
*@param keyAsString This is Key , which we are using for encrypting the string.(Hex representation)
*@param initialVectorAsString This is initialvector we are using for encrypting the string.
*@return return value is Encrypted String
*/
    public static String getAESEncryptedString(String passwordAsString,
            String keyAsString, String initialVectorAsString) {
        try {

            byte[] key = new BigInteger(strToHex(keyAsString), 16)
                    .toByteArray();
            byte[] iv = new BigInteger(strToHex(initialVectorAsString), 16)
                    .toByteArray();

            //byte[] key = {0x64,0x64,0x31,0x62,0x58,0x41,0x31,0x61,0x66,0x36,0x66,0x36,0x39,0x31,0x63,0x62};
            // byte[] iv =  {0x61,0x32,0x32,0x65,0x63,0x37,0x30,0x36,0x30,0x30,0x67,0x31,0x33,0x65,0x64,0x38};
            System.out.println("key value in bytes : " + key);
            String text = passwordAsString;
            String encrypted = encrypt(text, iv, key);
            System.out.println("Pass  encrypted is " + encrypted);
            String decrypted = decrypt(encrypted, iv, key);
            System.out.println(encrypted + " decrypted is " + decrypted);
            return encrypted;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;

    }


/*This method converts String value to its equivalent Hex Representation.
*@param str This is string to be converted to its equivalent Hex representation.
*@return return string in Hex Representation
*/
    public static String strToHex(String str) {
        char[] chars = str.toCharArray();
        StringBuffer hexStr = new StringBuffer();

        for (int i = 0; i < chars.length; i++)
        {

                        hexStr.append(Integer.toHexString((int) chars[i]));

        }
        return strBuffer.toString();
    }

/* encrypt method encrypts the string provided using provide key and initial vector.
*@param text String value to be encrypted
*@param iv Initial Vector's byte Array value
*@param key Key's byte Array Value
*@return String This is encrypted String
*/
    public static String encrypt(String text, byte[] iv, byte[] key)
            throws Exception {
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");

        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
        IvParameterSpec ivSpec = new IvParameterSpec(iv);

        cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
        byte[] results = cipher.doFinal(text.getBytes("UTF-8"));
        BASE64Encoder encoder = new BASE64Encoder();
        return encoder.encode(results);
    }


/* decrypt method decrypts the string using provide key and initial vector.
*@param text String value to be decrypted

*@param iv Initial Vector's byte Array value

*@param key Key's byte Array Value

*@return String This is decrypted String
*/
    public static String decrypt(String text, byte[] iv, byte[] key)
            throws Exception {
        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");

        SecretKeySpec keySpec = new SecretKeySpec(key, "AES");
        IvParameterSpec ivSpec = new IvParameterSpec(iv);
        cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);

        BASE64Decoder decoder = new BASE64Decoder();
        byte[] results = cipher.doFinal(decoder.decodeBuffer(text));
        return new String(results, "UTF-8");

    }

}