Posts

Showing posts from 2011

Simple Hands on Hibernate

Image
Hi, In the below post will try to explain how to create simple Hibernate Project from crash. Below is the scenario: I have an EVENT table and want to insert one simple row in that table. Here is the table script: CREATE TABLE EVENT_DETAILS  ( NAME VARCHAR2(20),  LOCATION VARCHAR2(20),  ID VARCHAR2(20) NOT NULL,  CONSTRAINT EVENT_DETAILS_PK PRIMARY KEY (ID) ) First, you need to download the Hibernate Distribution Bundle, you can get it here: http://www.hibernate.org/downloads Extract the Zip file and use Hibernate.jar . Here I downloaded " hibernate-distribution-3.6.8.Final " but we will be traditional mapping files in this example. Now, create a new Java Project in eclipse. Say, " SampleBankPartyApp ". Create a folder structure under your project: " config/orm/hibernate/cfg " and " config/orm/hibernate/hbm " Next, we need to create Hibernate Configuration file. Here I am using Oracle 11g database. You can change the confi

Steps to Install Maven on windows

1. Go to http://maven.apache.org/download.html#Installation 2. Download Maven 2.2.1 Binary “ apache-maven-2.2.1-bin.zip ” 3. Extract the ZIP where you want to install maven. For eg. “D:\Maven\apache-maven-3.0.3” 4. Add the M2_HOME environment variable and set it to “D:\Maven\apache-maven-3.0.3” 5. Add the M2 environment variable and set it to “D:\Maven\apache-maven-3.0.3\bin” 6. Add “D:\Maven\apache-maven-3.0.3\bin” to your PATH variable. 7. Open the command prompt and type “mvn --version” to test whether its installed or not.     It should print:     Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530)     Maven home: D:\Maven\apache-maven-3.0.3     Java version: 1.6.0_22, vendor: Sun Microsystems Inc.     Java home: C:\Program Files\Java\jdk1.6.0_22\jre     Default locale: en_IN, platform encoding: Cp1252     OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Important point regarding "OSB Publish Action "

Image
Hi, I had used OSB publish action to make  asynchronous call to the external service. While working on this, I found that, If we used OSB Publish Action to call the OSB proxy service (on Local, or on HTTP) it becomes a  synchronous call and Thread get block till we don't get the response.  OSB Publish Action work  asynchronously only when the Publish call is from Proxy service to Business Service.  For example: Consider an order proxy which make a Publish call to OSB logger Proxy and OSB Logger proxy then may call a Business Service to log the data. Here the call from Order proxy to Logger proxy is Synchronous, even though we expect it to be Asynchronous. The way around:  One solution is you make a publish call from OSB Logger proxy to OSB Logger Business Service. You can used publish or a call out at Order Proxy. In this way you can have a asynchronous call to Logger Proxy. Thanks, Rohan Lopes

Generating keystore using JAVA keytool

Overview keytool  is a key and certificate management utility. It enables users to administer their own public/private key pairs and associated certificates for use in self-authentication (where the user authenticates himself/herself to other users/services) or data integrity and authentication services, using digital signatures. Its based on public key encryption method. keytool  stores the keys and certificates in a so-called  keystore.  Keystore contains:              1.  key entries              2.  Trusted certificate entries In this post I have tried to explain how to use the Java Keytool to generate the keystore and certificate. Following are the steps below to generate Java keystores for the consumer(A) and producer(B)  : 1. Use below command to generate keystore :   keytool -genkeypair  -keyalg RSA -keypass welcome1 -keystore consum er_A.jks  -storepass welcome1 What is your first and last name?   [Unknown]:  John What is the name of your organizational unit?

Calling web service hosted outside firewall i.e. Internet from Oracle Service Bus (OSB)

Image
There is often a need to call the web service that is Hosted Outside the Firewall. For eg. Lets say we want to use the "ISBNTest" web service published on xmethods.net, OSB won't be able to send the request with out setting the proxy. Following are the steps to carry out the proxy setting:- 1. Create the business service based on WSDL of external web service. 2. Create new Proxy Server . You need to select the OSB Configuration project to create the proxy server, as all the configuration setting are maintain under Configuration project. 3. Click Add Host-Port parameters.     Enter Server Host, Text Port and SSL port. 4. Click Save 5. Go back to the business service, Under HTTP transpor t click Advance Select the proxy server that you created above. 6. Now when you test your business service, it will use the proxy mention in Proxy Server and call the web service. Do let me know if you find any issue. -Rohan Lopes

Implement Parallel Split Join OSB

Image
Example for implementing parallel Split Join in Oracle Service Bus ( OSB ) 11g: Consider the following is the scenario: We have a Customer Inquiry Service, which takes Cust_ID, Cust_name and Brand as an Input and return Cust_ID, Cust_name and Balance as an output. You will receive a customer list as an Input, here instead of calling " Customer Inquiry Service " sequential,  We can use Parallel Split Join In OSB to make the parallel call to " Customer Inquiry Service ". The response from all the requests will be aggregated and return back to the client. Following are the steps: I created a simple XSD that will take list of customer request and return the list of response. Request Xsd Created a simple WSDL based on the request and response element mentioned above Created a Dummy   " Customer Inquiry Service " proxy service (Customer.proxy) that will return a sample response. Base the proxy service on the WSDL created above. Will call this p