Disclaimer : This blog space does not necessarily reflect my views/ideas on the technology and beyond doubt, never reflects the views of my employer.

Sunday, September 28, 2008

Oracle Serivce Bus (ALSB) - Day 3

This post would be the first and last post in the series where we will create the ALSB example and call the BPEL service on SOA Suite.

Hope you have ceated the local server instance and after starting the server you are able to view the ALSB console at http://localhost:7001/sbconsole as per my last post. For my example, today I have created seperate server instance at port 7041, but you can always use the good old 7001 port which we created last time. Now, let's start with our example.

First find out the BPEL Service WSDL URL handy, do test it before you end up choosing the same. For my example I've selected, the well-known "Hello World" BPEL Service. The URL for my BPEL service is http://WWW-XYYZZZ.corp.ABC.CO:8888/orabpel/default/Helloworld/1.0?WSDL.

Start the server from WorkSpace Studio. Open the ASLB console in the browser and login. Ont he left hand side-bar you will find the "Change Center" as shown below.

Click on "Create" to activate your session. Basically, the Change Center allows for team collaboration when services and metadata are being configured in ALSB. Each user works in a sandbox session until the user is ready to check in the working configuration to the core configuration of the bus. The change center provides multiple levels of undo, and visibility into conflicts, as multiple users work on the configuration.

Now, we are ready to do the changes. click on the "Project Explorer" from the links available right below the Change Center.

You may need to scroll down to view this "Project Explorer" link. On the right hand, you will get option to create the folder.

Write a name HelloWorldExample and click on "Add Folder" and you will see the project created with name "HelloWorldExample".

You can also observe the same in left side menu of Project Explorer. Now click on "HelloWorldExample" from the list of the projects and it will open the folder "HelloWorldExample" for you.

As we created previously, create three folders inside "HelloWorldExample" namely WSDL, Business Service and Proxy Service.

Your project explorer should look like this

Now, the steps to be followed are,
1) Import WSDL URL : This will be the concrete WSDL to BPEL service.
2) Create Business Service : For the time being this can be thought as service endpoint of Oracle ESB
3) Create Proxy Service : For the time being this can be thought as routing service of Oracle ESB
4) Test the Proxy Service : This is an ALSB Test Client like we have inovke option in BPEL PM.

1) Import WSDL : inside Project Explorer, click on WSDL and you will be inside WSDL folder. From the drop-down Create Resource, select option "Resource from URL".

In URL/path give the WSDL URL. Resource Name "WSHelloWorld" and Resource Type is "WSDL". Click "Next".

It will take you to the "Review Loaded Resources" screen and shows that one WSDL and related schema files are to be imported. Select all the resources and click "Import". The resources are imported in folder WSDL.

2) Create Business Service : inside Project Explorer, click on HelloWorldExample --> Business Service and you will be inside "Business Service" folder. From the drop-down Create Resource, select option "Business Service".

Give the name "BSHelloWorld". Select WSDL Web Service option and click on Browse, From the list of Web Service select "WSHelloWorld" which we created in Option 1.

The popup will come up, select port option as displayed in the screen below and click "Submit".

You are back to create Business Services Screen, Click Next and observce the "Endpoitn URI". Go to the last step and Save.

The Business Service is successfully created.

3) Create Proxy Service : The similar way select Proxy Service folder and select option "Proxy Service" from Create Resource drop-down. Give name "PSHelloWorld".

Similar to step 2, select WSDL and create the proxy service. Once Proxy service is created, go to the folder "Proxy Service" and click on the icon Edit Message Flow".

Now, from pop-up, goto Variable Structure --> body and select the input variable from request. Drag and drop it to the Text Area on the right.

Validate the Message Flow, Save the Stage Configuration. Save the Message Flow. You are back to the Proxy Service folder.

Now, in change Center, click on "Activate", give proper description of the change and submit. Now the changes; right form creation of the Project folder to the Message Flow are applied to the Server.

4) Test the proxy Service : Click on Spider icon in Actions given for Proxy Service.

If you are getting the following error screen, then I must say that you are on the right way.

This is due to the current inability for ALSB to handle the partnerlink element in the WSDLs generated by the Oracle stack.

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Helloworld" targetNamespace="http://xmlns.oracle.com/Helloworld" xmlns="http://schemas.xmlsoap.org/wsdl/"

<service name="Helloworld">
<port name="HelloworldPort" binding="tns:HelloworldBinding">
<soap:address location="http://WWW-XXYYZZZ.corp.ABC.CO:8888/orabpel/default/Helloworld/1.0"/>
<plnk:partnerLinkType name="Helloworld">
<plnk:role name="HelloworldProvider">
<plnk:portType name="tns:Helloworld"/>


To sovle this issue, in change center, click on Create to create the new session, goto click on WSDL file in WSDL folder and edit the wsdl text as given below.


<plnk:partnerLinkType name="Helloworld">
<plnk:role name="HelloworldProvider">
<plnk:portType name="tns:Helloworld"/>


<plnk:partnerLinkType name="Helloworld" xmlns:myTarget="http://xmlns.oracle.com/Helloworld">
<plnk:role name="HelloworldProvider">
<plnk:portType name="myTarget:Helloworld"/>

Activate the changes using Change center and test the proxy service.

That is all from my side. Drop a comment if you find it useful or if you are facing some issues with this implementation.

I'm thankful to Chris Tomkins who helped me to perform OSB(ALSB) adventure faster.



Oracle Serivce Bus (ALSB) - Day 2

I'm back with next episode of ALSB. Sorry for the delay in posting this. I have decided to discuss architecture post to hands-on. Today, we will discuss how we can create server/ server domain in ALSB. This will also help to get familiarized with environment.

So, why we need to create this server? This is to define a local server instance which we can use to deploy our resources to. Once the server is available, we can go ahead to create the ALSB resources and depoly them. So, let's start creating the server ... Go to Start Menu --> BEA and select WorkSpace Studio 1.1 as shown below:

Workshop Studio is an IDE like JDeveloper. Using workspace studio, you can work with Service Bus on design time as we do with Oracle ESB in JDeveloper. Now, Workspace launcher pop up will come up and usually it would be pointing to "WorkSpaceStudio" folder where bea is istalled.

To select the default value, select "OK" and the workspace studio IDE will come up. As the workspace studio is based on Eclipse, it has different perspectives for IDE views. Go to menu Window --> Open Perspective and selct Others option. The pop up with the list of perspectives will come up as shown below:

Select "AquaLogic Service Bus" and click OK. You are back to IDE but with the ALSB perspective.

Now, in order to create new server, from the menu select File --> New --> Server. The New Server wizard will come up.

Here we have to choose the type of server we want to create. keep the server name "localhost" as it is. Make sure you have selected option "BEA WebLogic Server v10.0" from the list of servers. ALSB 3.0 is compatible only to that version. However, the new version of WebLogic Server 10.3 is now available on OTN fro download. Click "Next".

You will reach to the 2nd page of Create Server wizard. Here we have to define our server. Change the name as you find it appropriate. Then select the link "Click here to launch Configuration Wizard to create a new domain" link in order to create the new domain.

In the next screen give the username and password as you desire it. I will prefer to go with "weblogic" as both username and password.

Continue with the options as given in the screen shots below.

Select JDKs and Startup mode. In Development mode, username and password will be taken from boot.properties file and do not require to enter. For developement mode Sun JDK is suggested for better performance. On the contrast, for Produciton mode, credentials are to be entered manually and JRockit is a prefered Java kit.

Select "No" to keep the default settings for the domain. If you select "Yes" in order to customize, you will be asked for the server name, server port and many other configurations. The next post, the server used is customized on a different port 7041 while the default port is 7001.

Click Next,

Enter the Domain Name and Domain Location.

I would prefer to keep the default location /user_projects/domains as it will make the task to find the default domain folder easy. Click "Next"

The domain has been successfully created. If you want you can select the option "Start Admin Server". Click "Done" and you will be back to "New Server Wizard".

For Domain Home, browse and select the domain which you have recently created. and click "Finish" to accept the default settings.

Now, we are back to IDE, on the right bottom click on the "server" tab. you will see the server which you have just created in the list of the servers.

Right click your server and from the context menu select the option "Start" to start the server. The status of the server will change to "starting" and then "started". You can see the progress bar at the right bottom end.

Alternativerly you can always clickon the Console tab and find out the progress of the server. Generally, when server is started, you will get the last line like "sever in ". You can check from the console if there was any error while starting the server or not.

Now, the server is started, and we want to see the console in the browser. So, open the browser and type address:

http://localhost:7001/sbconsole for ALSB console and

http://localhsot:7001/console for WebLogic console.

You can browse through different console environments. Mainly we will be using the ALSB console to create our ALSB.

That's all for today. In next post, I will create the only ESB example of this series. I will create one ESB and we will call BPEL service from our SOA Suite server 10133. So, our example will be of kind ALSB --> BPEL. We will invoke ALSB from the ALSB Test Console, yes, ALSB has test console like BPEL inovke option in BPEL PM.

You might have surprised as why I'm not taking File or Database example in ALSB. The answer is that to achieve File and Database stuff is bit difficult in ALSB compare to adapters we are using in Oracle ESB. Also, in future, the adapter mechanism of Oralce ESB will be part of new Oracle Service Bus, so no need to concentrate on those functionalities. We are just familiarizing here with WL Server and ALSB as they are the way going forward for j2ee server and Service bus in Oracle FMW stack.

Don't forget to drop a comment if you have to share something.



Oracle Service Bus (ALSB) - Day 1

Oracle's FMW strategy is out long back and OSB(Former ALSB) is the way going forward in terms of Oracle's Enterprise Service Bus product.

Also, to notice that on SOA Suite link on oracle, they have already included included OSB as an individual product. so, here I'm startingsmall series of posts on OSB that covering introduction, features, architecture, configuration and sample tutorial execution. I'm not sure but if possible I would try to compare the features of those in Oracle ESB with OSB.

First of all, I downloaded OSB from OTN. I got 867 MB of zip file consisting installable exe file named alsb300_wls100_win32. The recommended RAM requirement is 2 GB, bt i'm happy as my system has sufficient RAM to install the same.

Installing ALSB was quite smooth. Generally while installing Oracle SOA Suite 10131, I'm restarting OPMN manually to push the stuck installation.

If you will go with the default installation, you will get following three components installed on your system.

  1. WebLogic Server 10.0
  2. AquaLogic Service Bus 3.0
  3. WorkSpace Studio 1.1

After successfull installation the WebLogic Server automatically comes up, this server is the way going forward the strategic J2EE server as Oracle has declared as a part of the strategy. Enter weblogic as both username and password if you want to access server's Admin Console. Like Oracle AS, this server also using jdk 5, supports EJB 3.0, WS-I and more ...

I created new Server instance for my OSB tutorials (we will discuss this in later posts). ALSB Console enables you to control the service and policy configurations, and monitor system and operations tasks. ALSB relies on WebLogic Server run-time facilities. The sbconsole(Service Bus Console) looks like this,

What I found interesting in help documents of ALSB console is the list of AquaLogic Service Bus Error Codes. These list describes the ALSB errors that can occur when a proxy service is being executed these Error Codes can be used while defining services to trap specific error in execution.

Workshop is an IDE built on the Eclipse platform that simplifies the process of developing web-based, service-oriented (SOA) and J2EE applications and looks like as below.

This is all for today, next we'll see how I created my server instance and then one example.

Let me know if you are looking for something specific from this post series of OSB.



Saturday, September 27, 2008

Oracle Forms Modernization with Fusion Middleware

I was reading about Forms Modernization on OTN. There are some links to good white papers and articles are available about Oracle Forms modernization; specially EuroTransplant and Griffiths Waite. Thought to put a post of my idea about how this process is executed

The key reasons for Form’s modernization could be:
Retain the current Investments
With continued support and investment in the technologies of your legacy applications, you have the ability to modernize from a platform of stability.
Adopt New Technologies
Service Oriented Architecture (SOA) allows you to realize new practices and technologies and to do so in a step-by-step basis
Integrate them
Both your legacy and new systems can integrate and share services allowing legacy applications to continue to run your business as you build up new systems and services.

Oracle Forms and SOA
The SOA Roadmap deconstructs legacy Oracle Forms systems into elemental components and recomposes them into a vast set of new application services.

The transition from Oracle Forms client/server to SOA should be a journey, not a single transformation. A staged (that is, phased) modernization effort enables Oracle Forms applications to be migrated over time. This lengthens the period of time during which Oracle Forms remains an architectural element, but reduces the overall migration risk during that time period. The first phase focuses on protecting customer’s existing investments by stabilizing the application and upgrading it onto a supported platform. Subsequent transformation phases will then gradually evolve the application to a Service Oriented Architecture.

The most critical and also the most difficult step in the transition to SOA is the migration to an n-tier Architecture focusing on establishing the business logic as independent to the database and client application. Once this has been achieved the transition to the upper levels of the Roadmap becomes significantly easier. Critically, system modules / business processes can be migrated one at a time and proceed at different speeds through the roadmap.

As per the white paper given on OTN, there are three areas where Oracle Forms can be integrated with a Service Oriented Architecture:

• Usage of external service

With functionality recently added to Forms it is now possible to call from Forms to Java making it feasible to use Web services and BPEL processes.

• Exposure of Oracle Forms business logic to the outside world

In a world of distributed applications, Forms code might need to be moved out of Forms and into a place where it can be used by other applications.

• Using the Application Server's infrastructure

Oracle Forms coexists and integrates with Oracle's Applications Server's infrastructure functionality. Forms' integration with Oracle Single Sign-on and Enterprise Manager falls in this section.

Here I have tried to create a diagram which gives an idea about the Forms Modernization Architecture.

Fig : Possible Forms Modernized architecture, also suggests
1) Integrating Forms with SSO using Enterprise Server
2) Separating the business logic to DB
3) Exposing the Forms business logic as PL/SQL Procedure of Web service
4) By using Java, calling outside objects directly from the Forms
5) Desired Integration options
a. Connecting Legacy/ERP applications using BPEL PM
b. Exchanging Information with Business Partners using BPEL PM and B2B

Some points below which can be explained in details for the above diagram.

1. When Forms becomes a part of a larger setting it needs to be able to participate in application server wide functions such as maintenance and management and user authentication. It doesn't make much sense to have one application use its own authentication scheme and all the others use another scheme. In versions 9 and 10 Forms is a full member of the Application Server infrastructure and is automatically configured to be able to use both the Single Sign-on server (Oracle OID and SSO) and to be managed thru Oracle Enterprise Manager.

2. The outside world use existing Forms business logic. Forms business logic can be exposed as a Web service Or Forms business logic which can be written in PL/SQL can be called directly ad Database Objects.

What we’ve to remember is that it is possible to move Forms PL/SQL code from Forms to the database and from there expose it to the outside world, either as a database procedure/function or as a PL/SQL Web service.

3. Oracle Forms use of external services hinges on recent functionality regarding Java integration. Oracle Forms can call out to Java on the file system. It can make use of Java beans and its native screen widgets can be customized with custom Java code (the Pluggable Java Component architecture). In this section we are going to touch on the functionality of calling out to Java code residing on the file system.

Once that functionality put in place Oracle Forms ables to call all kinds of external services such as Web services and be part of a BPEL process flow.

4. WebFoms : WebForms could be achieved by running APS on a Web server and emulating the graphical user interface in a generic applet in the client. So, instead of the traditional Oracle Client Server Forms solution, a Java UI can be presented to the user within a browser. The N-tier architecture of Web Forms is much more responsive when run across a large company network, significantly reducing the network traffic between the client and the data center, compared to the client/server architecture.

Hope this has given idea about Form’s modernization process. The references can be availed @ http://www.oracle.com/technology/products/forms/forms_modernization.html



Wednesday, September 24, 2008

Revisiting XPath

Was reading w3schools.com in order to learn more concepts of XPath and thought to create a post as extracting information from tutorial. Here is some ready information on XPath.

What is XPath?
  • XPath is a syntax for defining parts of an XML document
  • XPath uses path expressions to navigate in XML documents
  • XPath contains a library of standard functions
  • XPath is a major element in XSLT
  • XPath is a W3C Standard

or XPath is a language for finding information in an XML document. The XPath language is based on a tree representation of the XML document, and provides the ability to navigate around the tree through elements and attributes in an XML document by a variety of criteria.

In addition, XPath may be used to compute values (strings, numbers, or boolean values) from the content of an XML document. The current version of the language is XPath 2.0.

XPath became a W3C Recommendation 16. November 1999.

XPath was designed to be used by XSLT, XPointer and other XML parsing software.
In XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document (root) nodes.

If we have books.xml as below :
<?xml version="1.0" encoding="ISO-8859-1"?><bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
</book><book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
</book><book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
</book><book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>

If you carefully observer first book has title Everydat Itralian, 2nd Book is Harry Potter. To extract this values create HTML page in the similar folder where you have created above books.html as below :
<html> <body>
<script type="text/javascript">
function loadXMLDoc(fname)
var xmlDoc;
// code for IE
if (window.ActiveXObject)
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
alert('Your browser cannot handle this script');

// code for IE
if (window.ActiveXObject)
var nodes=xml.selectNodes(path);
for (i=0;i<nodes.length;i++)
document.write("<br />");
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
var nodes=document.evaluate(path, xml, null, XPathResult.ANY_TYPE,null);
var result=nodes.iterateNext();
while (result)
document.write("<br />");
</body> </html>

Open the html file in browser and check the output. It should be "Everyday Italian".
Please observe the following line in HTML page.
This is pointing to specific book tag in the xml file. book[1] points to the first book tag in the xml document. change the value from book[1] to book[2] and you will get output Harry Potter instead Everyday Italian.

Also, observe the following line in HTML page
var nodes=xml.selectNodes(path);
Check the highlighted lines in HTML page and this is self-explanatory.

Hope this XPath article helps. Hope to write mroe about XPath nodes in detail in near future.
Many thanks to w3schools.com


Tuesday, September 23, 2008

Debug properties for OC4J configuration in OPMN managed environment

When OC4J is installed as a component of Oracle Application Server, OC4J system properties must be manually added to the opmn.xml configuration file. The file can be found at \opmn\conf directory. Options will be passed to managed OC4J instances at startup. Set Java system properties in the element where the id attribute is java-options. This element is enclosed within the subelement of the element in the XML structure. Preface all system properties with a -D. For example:

< id="default_group">
< id="home" id="OC4J" status="enabled">
< id="start-parameters">
< id="java-options" value="-Doc4j.formauth.redirect=true -Dhttp.session.debug=true">
< /category>
< /module-data>
< /process-type>
< /ias-component>

Debug Property and their Description

Provides information about HTTP session events to the console.

Provides information about each HTTP request to the console.

Provides information about HTTP clustering events to the console.

Prints all HTTP errors to the console.

Enables the trace HTTP method.

Provides verbose information on creation of data source and connections using data sources and connections released to the pool.

Provides verbose information when JDBC calls are made.

Enables EJB clustering debug messages.

Prints RMI debug information to the console.

Provides verbose information on RMI calls.

Provides extra diagnostic information for J2CA connections.

Enables Web Services debugging.

Note : SOA Suite 10131 doc is the basis for the above doc. You can find more information @ http://download.oracle.com/docs/cd/B31017_01/web.1013/b28950/sysprops.htm



Domain Value Mapping in Oracle ESB

First of all, DVM is one of the features that will remain as a part of Oracle Service Bus in future. But yes, I’m not going to discuss how to create Domain Value Mapping (DVM) in ESB control. I will try to put some other information I have been working on and I have observed.

In a real time scenario there it is very common that two applications being integrated use two different values to represent the same information. Creating DVMs helps to hold a specific category of value mappings among multiple applications. Thus, multiple DVMs which are available across multiple applications enable you to associate values from one application with values from another.

Once DVM is created, you can find the metadata file at \integration\esb\oraesb\artifacts\store\metadata\files\dvm\.xml.def.xml. you can observe that xml file name contains data is stored in property “displayname” as below

The file containing DVM data can be found at \integration\esb\oraesb\artifacts\store\content\files\dvm\.xml. The typical DVM data file looks like below

< ?xml version = '1.0' encoding = 'UTF-8'?>
< name="StateCodes" isnew="null">
<>Mapping of state names, abbreviations, and codes < /description>
  <>  < name="Long">< name="Abbrev">< name="Short">  < /columns>
    <> <>Massachusetts< /cell>Mass< /cell><>MA< /cell>< /row>
    <> <>California< /cell><>Calif< /cell><>CA< /cell>< /row>
  < /rows>  < /dvm>

You can always create the similar xml files manually. Just make sure that you keep the name of the file similar to the name attribute in DVM tag. Then you can simply import this new DVM in the ESB Console.

What looks like below at the design time,

Looks like below in the Source XSL file


< select="/imp1:Root/imp1:name">

< /imp1:name> <>

< select="orcl:lookup-dvm('Country','FullName',/imp1:Root/imp1:country,'ShortName',">

< /imp1:country> < /imp1:Root> < /xsl:template>

If you know only BPEL and ESB (or say the well-known SOA Suite), then you may also like to note that DVMs is used in implementation of AIA also.

So, is it the end of discussing DVM ? No, one last point. Typically in real time scenario, at the starting of development, you will get the list of code-value pair and generally they are very large in number. So, be prepared to create some Java program to make it .xml file which can be imported in ESB Console instead of entering all the code-value pair.

So, are you ready to work with DVMs?