Tags

, , , , , , , , , , , , , , ,

To view this article by direct Oracle site see the link:

http://www.oracle.com/technetwork/pt/articles/soa/expondo-servico-oracle-service-bus-2507899-ptb.html

Or just follow the article as follows:

Oracle Service Bus or simply OSB, a very common error regarding OSB is to say that it implementsSOA or the fact of using a OSB in its architecture already turns into a Service-Oriented Architecture. In fact, the OSB is responsible for much of the features that SOA fold, but not all.

However, I will talk about in this post all the features of OSB for surely would be several posts for this since its range of features and possibilities would be immensely extensive, but you can get an idea by visiting this link of Oracle http://docs.oracle.com/cd/E11036_01/alsb30/userguide/intro.html

This article will describe the main components of OSB are::

OSB STUDIO

The development environment for OSB components is supported through Eclipse and a specific plugin for OSB.

OSB PROXY SERVICE

The proxy service that is being uncoupled from the client, can be generated in different protocol types.

OSB BUSINESS SERVICE

Service being coupled to the bus and / or participating in an integration.

In this example will exhibit at OSB our service built in BPEL as my Post:: Selecting data using the Database Adapter (BPEL DbAdapter) Oracle SOA Suite 11g

I using Version: 3.6.2 as follows:

Imagem Blog UansCarvalho

Based on the principle that you and I have no project and just make the installation of OSB we open the OSB STUDIO which is nothing more than an Eclipse with many plugins Oracle, and put the path where it will be our workspace that will be where will our project. In my case I’m using Linux: /home/uans/workspace_osb_blogUans

Imagem Blog UansCarvalho

After clicking OK this is the splash screen: Click Workbech

Imagem Blog UansCarvalho

From the menu, click File >> New >> Other .. The screen below, then go to the Oracle Service Bus folder and select the Oracle Service Bus Configuration Project option and click Next

Imagem Blog UansCarvalho

On the next screen click Finish

Imagem Blog UansCarvalho

Onscreen down click Yes:

Imagem Blog UansCarvalho

Now we have the following screen:

Imagem Blog UansCarvalho

Click again on File >> New >> Project ..

The screen below, then go to the Oracle Service Bus folder and select the Oracle Service Bus Project option and click Next

Imagem Blog UansCarvalho

On the screen below will be as OSB Project 1, then rename it to OSBProject for this project configuration can be no room for not having future problems when mapping the XSDs and WSDLs, then click Finish

Imagem Blog UansCarvalho

Right button click OSBProject and select New >> Folder

Create the following folder structure:

  • Business
  • Proxy
  • WSDL
  • XSD

Imagem Blog UansCarvalho

Okay, now we have our setup and structure of our project, we now bring to our OSB BPEL Project, for this we go to EnterpriseManager (EM) BPEL:

In your browser go to http://localhost:10000/em

Note: The port 10000 is the number that I chose to create my BPEL Domain

Login:

Imagem Blog UansCarvalho

Click on your project: SelectDBAdapter[1.0]

Imagem Blog UansCarvalho

Click Test

Imagem Blog UansCarvalho

This will be your WSDL that we should export to the OSB:

Imagem Blog UansCarvalho

But for this, copy and paste the URL in your browser:

Imagem Blog UansCarvalho

In this screen we extract our WSDL and XSD our:

On this screen select, copy the portion of XSD as follows:

Imagem Blog UansCarvalho

Which should look like this:

Imagem Blog UansCarvalho

Now, on the screen click the right button and select View Page Source (see source code)

Then we should see the screen as well:

Imagem Blog UansCarvalho

Copy the contents of this screen and return to the OSB

Note: If in your WSDL has more XSDs then we must also copy them to the OSB, and note that this is the same XSD that will be in your BPEL project.

Click on the XSD folder:

Imagem Blog UansCarvalho

Now click on Menu and select File >> New >> File

In File Name: Place SelectDbAdapterBPEL.xsd and click Finish

Imagem Blog UansCarvalho

Click Source and paste the xsd content you selected above:

And we should have the following screen:

Imagem Blog UansCarvalho

Now on the screen where you pasted the WSDL:

Imagem Blog UansCarvalho

Click the right button and choose View Page Source (View source code)

Imagem Blog UansCarvalho

Copy the contents of this screen and return to the OSB Click on the WSDL folder:

Imagem Blog UansCarvalho

Now click on Menu and select File >> New >> File

In File Name: Place SelectDbAdapterBPELContract.wsdl and click Finish

Imagem Blog UansCarvalho

We will have an empty WSDL:

Imagem Blog UansCarvalho

Now paste the WSDL screen content that we copied earlier and looks like this:

Imagem Blog UansCarvalho

But note that our WSDL is in trouble for this with some X” as follows:

Imagem Blog UansCarvalho

The problem here is just because he is not finding the reference to our XSD, ie, there is a XSD dependency that is not being found as shown in the Problems tab of our OSB:

Imagem Blog UansCarvalho

In our WSDL locate the part below:

Imagem Blog UansCarvalho

In schemaLocation line, leave just so:

schemaLocation=”../../OSBProject/XSD/SelectDbAdapterBPEL.xsd”/>

Because this is where this XSD in our project

Imagem Blog UansCarvalho

Save the file and see that no more problems in our project:

Imagem Blog UansCarvalho

Now let’s create our Business Service:

Click on the folder Business

Imagem Blog UansCarvalho

Now click on the menu and select File >> New >> Business Service and File Name: place SelectDbAdapterBPELBusiness and Finish

Imagem Blog UansCarvalho

In the screen below select the WSDL Web Service option and click Browse to locate our WSDL:

Imagem Blog UansCarvalho

On the next screen choose: selectDBAdapterBPELProcess_pt(port) and click OK

Imagem Blog UansCarvalho

On this screen, click Yes to confirm the changes

Imagem Blog UansCarvalho

Save now the changes:

Imagem Blog UansCarvalho

Everything OK, let’s now create our Proxy Service

In on the Proxy folder

Imagem Blog UansCarvalho

Now click on the menu and select File >> New >> Proxy Service (be careful, it is not Proxy Server because there the two) and File Name: place SelectDbAdapterBPELProxy and Finish

Imagem Blog UansCarvalho

In the screenshot below, again select the WSDL Web Service option and click Browse to locate our WSDL:

Imagem Blog UansCarvalho

On this screen, click Yes to confirm the changes

Imagem Blog UansCarvalho

Save the changes now:

Imagem Blog UansCarvalho

Now click on the tab below Message Flow

Imagem Blog UansCarvalho

At your right side in the Oracle Service Bus Message Flow tab and drag the Route component so that it is below its SelectDbAdapterBPELProxy, and release as follows:

Imagem Blog UansCarvalho

Now to your right on Route Actions tab, choose the Routing component and drag into your RouteNode1 that should look like this:

Imagem Blog UansCarvalho

Now click on the Routing and name below the Properties tab

Imagem Blog UansCarvalho

Click Browse and select SelectDbAdapterBPELBusiness.biz as below and click OK.

Imagem Blog UansCarvalho

Now the Properties tab select the process on invoking:

Imagem Blog UansCarvalho

Click Save, and the Servers tab make Publish your project as below:

Imagem Blog UansCarvalho

Note: If you have not configured your Server do the following:

Click the right mouse button on the Server tab that must be empty conform below:

Imagem Blog UansCarvalho

Select New >> Server

Appears the box below, then the Oracle folder and choose Oracle WebLogic Server 11gR1 PatchSet 4 and click Next:

Imagem Blog UansCarvalho

As indicated below, on the Configuration tab, under Domain diretory place where your domain and click Next:

Imagem Blog UansCarvalho

In the image below OSB Configuration 1 select one and click the Add > button for it to go to the right side of the screen in the Configured tab and click Next

Imagem Blog UansCarvalho

In the screenshot below you can now click Finish

Imagem Blog UansCarvalho

After that, if you have not done yet, you can already do the Publish:

Imagem Blog UansCarvalho

Make sure that your Publish was successful because it should be as follows (Started, Synchronized)

Imagem Blog UansCarvalho

Let’s do the test to make sure everything worked perfectly.

In your browser go to http://localhost:9000/sbconsole

Note: The 9000 port is the number I chose to create my Domain OSB

Login:

Imagem Blog UansCarvalho

Click Resource Browser and right side should appear to our Proxy SelectDbAdapterBPELProxy

Imagem Blog UansCarvalho

On the right side the Actions tab click the icon that looks like a “green cockroach:

Imagem Blog UansCarvalho

You will see the screen below, and put the idCliente value 7839 which is a idCliente that exists in my base and then click Execute:

Imagem Blog UansCarvalho

See Response Document in the response of our service:

Imagem Blog UansCarvalho

 

Doubts? Leave your comment and download this Projet 🙂

 

Hugs and to the Next

/:-D