Disclaimer : This blog space does not necessarily reflect my views/ideas on the technology and beyond doubt, never reflects the views of my employer.
Showing posts with label ALSB. Show all posts
Showing posts with label ALSB. Show all posts

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"/>
</port>
</service>
<plnk:partnerLinkType name="Helloworld">
<plnk:role name="HelloworldProvider">
<plnk:portType name="tns:Helloworld"/>
</plnk:role>
</plnk:partnerLinkType>

</definitions>

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.

Change

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

with

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


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.

Cheers

Nirav


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.

Cheers

Nirav

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.

Cheers

Nirav