Saturday, August 29, 2009

Creation of a simple Web Service

It is important to understand what a webservice is, WSDL and how to create one so that you understand the orchestration of services.
Here you will learn how to create a simple web service that calculates the APR based on the FICO score.

What you will learn
  1. Creation of Application and Project in JDeveloper
  2. Creation of a simple WebService
  3. Understand the WSDL
  4. Test the webservice
  5. Deploy the webservice
Steps to follow
  • In JDeveloper, select "New Application" in "Application Navigator"
  • To create the Application, enter the "Application Name", "Directory" as shown below
  • To create the project, enter the "Project Name" and "Technologies" as shown below
  • Finish the creation of the project
  • Create a new Java Class as follows
  • Enter the name of class as "CreditService" and accept the other defaults
  • Declare the class to be a WebService
  • Configure web.xml for this service. Select "Jave EE 1.5, with support for JAXWS Annotations" as the deployment platform.
  • Create a getCreditRating() method and declare it as WebMethod

  • Test as WebService
  • The JDeveloper starts the Weblogic server, runs the webservice and launches the test analyzer. Enter the input and the service returns the output.

  • TODO The WSDL is to be explained

Oracle SOA Suite 11g Installation - Part3/3 - JDeveloper

This blog covers the following

  • Installation of Oracle JDeveloper 11g
  • Configuration of JDeveloper
  • Useful Links
Installation of JDeveloper
  1. You can download from here as "Studio Edition" jdevstudio11111install.exe
  2. Start the installation
  3. Select the [Middleware] home where Oracle SOA Suite 11g was installed(c://oraclefusion)
Configuration of JDeveloper
  1. Start the JDeveloper from C:\oraclefusion\jdeveloper\jdeveloper.exe
  2. Accept the Default Role on startup
Create Application Server Connection
  • Click on the "Resource Palette" to expand it

  • Select New Connection>Application Server
  • In Step1/5, enter connection name as "crystal" 
  • In Step2/5, enter the username and password to the "crystaldomain" created earlier in weblogic
  • In Step3/5, enter WLS Domain as "crystaldomain"
  • In Step3/5, test the connection
  • If all the 8 tests are successful then the JDeveloper is configured to the weblogic domain.   

Wednesday, August 26, 2009

Configuration of Oracle SOA Suite 11g

Note This blog is a continuation of the Oracle SOA Suite Installation

Create a new domain on Weblogic server
  1. Go to Program Files> Oracle Weblogic>Weblogic Server11gR1>Tools>ConfigurationWizard to create a new weblogic domain
  2. Select SOA, BAM, EM checkboxes and accept all the defaults in the other screens
  3. For the schema, change the Oracle Service name to "xe" is you are using Oracle XE database  
  4. The newly created domain can be seen at C:\oraclefusion\user_projects\domains\crystal_domain
Starting the server
  1. On the command line, enter startweblogic to start the domain 
  2. By default, the AdminServer starts at port 7001. It can be accessed at http://localhost:7001/console
  3. On the left side select DomainStructure>[NewDomain]>Environment>Machines and edit LocalMachine
  4. Go to NodeManager tab and select Type as "Plain" and enable the debugging
  5. Open C:\ oraclefusion\wlserver_10.3\common\nodemanager\nodemanager.properties and change SecureListener=false
  6. Go to C:\ oraclefusion\wlserver_10.3\server\bin and startNodeManager.cmd
  7. Go to AdminServer and select DomainStructure>[NewDomain]>Environment>Servers
  8. Start soaserver1 
  9. Start bamserver1

Problems and Workarounds
  1. While starting the soaserver1 if you get a out of memory for perm area then you need to increase the perm memory by setting XX:MaxPermSize=512m  C:\oraclefusion\user_projects\domains\crystal_domain\bin\setSOADomainEnv.cmd
  2. If this does not solve the problem then you should recreate the domain by selecting JRockit as the JVM
  3. soa_server1 logs are available at C:\ oraclefusion\user_projects\domains\crystal_domain\servers\soa_server1\logs
  4. bam_server1 logs are available at C:\ oraclefusion\user_projects\domains\crystal_domain\servers\bam_server1\logs

Oracle JDeveloper 11g
  1. Download from here 

Saturday, August 22, 2009

Getting Started - Installation of Oracle SOA Suite 11g

The following needs to be installed on your desktop to start working with Oracle BPEL. Installing all this on your desktop or laptop will help you run it anytime and anywhere. These instructions have been tried on Windows Vista.
  1. Oracle Database 10g Express Edition
  2. Repository Creation Utility(RCU)
  3. Oracle Weblogic Server 11g(10.3.1)
  4. Oracle SOA Suite 11g 
  5. Oracle JDeveloper 11g
Note 

  1. The installation guides for all the above are available here 
  2. You need to sign into OTN and accept the license to be able to download.


Oracle Database Express Edition10g or 11g 
  1. Download 10.2.0.1 from here  as OracleXEUniv.zip
  2. While installing, enter "system" as password for "sys" and "system" database accounts. 
  3. After installation, login with "system" account to ensure that it was installed successfully.
  4. Now, set the oracle parameters as follows. This is required by the RCU in next step


Open "Run SQL Command Line"


SQL> connect sys as sysdba
SQL> alter system set PROCESSES=500 scope=SPFILE;
SQL> alter system set open_cursors=500 scope=SPFILE;
Go to Services and restart "OracleServiceXE" 
Repository Creation Utility
  1. Download it from here as ofm_rcu_win32_11.1.1.1.0_disk1_1of1.zip
  2. Go to C:\rcuHome\BIN and execute rcu.bat
  3. In the Step2/7, "Create Repository", choose to create a repository
  4. In the Step3/7, "Database Connection Details", enter the following values

    1. Host Name : localhost


    2. Port 1521
      Service Name xe
      Username sys
      Password system
      Role SYSDBA

      Note Ignore the warning "The database you are connecting is not a supported version".

  5. In the Step4/7, of wizard "Schema Passwords"(system) enter a password and make a note of it.


  6. In the Step5/7 of wizard "Map Tablespaces", accept the values and proceed. If you get an error in the creation of "Portal" tablespace ignore and proceed. 

    Note  Detailed instructions are available here  
Oracle Weblogic Server 11g(Actual Version is 10.3.1)
  1. Download from here as net_oepe11_wls1031.exe
  2. The directory structure of Oracle SOA Suite can be seen here 
  3. Enter a Middleware Home directory. I created this as "oraclefusion"
  4. The Weblogic server and Eclipse are installed in sub folders. 
Note  Detailed instructions are available here  
Oracle SOA Suite 11g
  1. Download from here as ofm_soa_generic_11.1.1.1.0_disk1_1of1.zip
  2. Extract this to a temp folder.[c:\temp]
  3. At Command Line, go to disk1 folder and run setup.exe -jreLoc C:\oraclefusion\jdk160_11\jre
  4. This launches a wizard. Step3/6, select the Middleware Home directory, "oraclefusion"
Configuration of the SOA Suite will be covered in the next blog.