Accessing Data Services Through AquaLogic Service Bus
AquaLogic Data Services Platform can be accessed from AquaLogic Service Bus. Thus an AquaLogic Service Bus client make full use of data services (Figure 8-1). This allows a more efficient and flexible approach to accessing data services than exposing them as web services via WebLogic Workshop and Java Web Services (JWS).
To make an AquaLogic Data Service Platform data service available to an AquaLogic Service Bus client, you need to do the following:
Deploy the AquaLogic Data Service Platform transport in the AquaLogic Service Bus as an application;
Generate the WSDL file for the data service of interest and import it into the AquaLogic Service Bus;
Generate a business service based on the WSDL and generate a proxy service based on the business service.
Your client is then able to access the data service as an AquaLogic Service Bus client.
Figure 8-1 AquaLogic Data Service Platform and AquaLogic Service Bus Interoperability Architecture
The following section provides the details.
Accessing AquaLogic Data Services Platform from AquaLogic Service Bus
Note:
The following assumes that you are running AquaLogic Service Bus 2.5 under WebLogic Server 9.2 and AquaLogic Data Service Platform under WebLogic Server 8.1.
Perform the following steps to access AquaLogic Data Services Platform from AquaLogic Service Bus:
Step 1: Start Your Servers
Start the WebLogic Server 9.2 for the AquaLogic Service Bus application needing access to your WebLogic Server 8.1 data service.
Start the WebLogic Server 8.1 for the data service.
For example, suppose that the MortgageBroker application sample in AquaLogic Service Bus needs access to a RTLApp data service that comes with AquaLogic Data Service Platform.
You then need to start the server for the AquaLogic Service Bus Mortgage Broker examples (on Windows you can do this by selecting:
Start All Programs BEA Products Examples AquaLogic Service Bus Start Examples Server
You also need to start the server for the RTL demo (on Window you can do this by selecting:
Start All Programs BEA WebLogic Platform 8.1 BEA AquaLogic Data ServicesPlatform2.5 Examples RTL Demo Launch RTL Demo Server
Step 2: Generate the WSDL for the Data Service
You can obtain the WSDL for the Data Service in two different ways. Each is described below.
Generate the WSDL Through WebLogic Workshop 8.1
Launch WebLogic Workshop 8.1.
Navigate in the Application panel (on the left) to your data service (.ds file) that you want to be available from AquaLogic Service Bus and select it.
Right-click to select Generate WSDL File for Service Bus (Figure 8-2). A WSDL file for the data service will be generated in the same directory where the data service is located.
Figure 8-2 Generate WSDL for Service Bus Dialog
For example, if you had navigated to the Customer.ds file in the RTLApp, Customer.wsdl will be generated.
Export the WSDL with the AquaLogic Data Service Console
Launch the AquaLogic Data Services Console.
On Windows you can do this by selecting:
Start All Programs BEA WebLogic Platform 8.1 BEA AquaLogic Data Services Platform 2.5 Examples RTL Demo AquaLogic Data Services Console
You can also do this by typing http://localhost:7001/ldconsole in your web browser.
In the project navigator on the left, select ldplatform, then your application underneath it.
Next navigate to Data Services and to the data service for your application.
For instance, if your application were the RTLApp example application, then you would navigate from ldplatform to RTLApp to Data Services to RTLServices.
Pick the particular service that you want to export.
If you were exporting a service from the RTLApp example, you might pick Customer.
Click Export WSDL in the far right column of the data service you want to export. You will be given the opportunity to save it to any location.
Step 3: Deploy the Data Services Transport
Launch the AquaLogic Service Bus console, then select the WebLogic Server Console.
The WebLogic Server Console will appear in a new window. Click on Deployments under Your Deployed Resources.
When the Summary of Deployments panel appears, click Lock & Edit under Change Center on the left.
The Install button then becomes active. Click it.
In the Install Assistant, navigate to the deployment EAR file, dsp_transport.ear, in WebLogic Server 8.1.
In Windows, this is located at: <bea_home>\weblogic81\liquiddata\application\
Then select dsp_transport.ear and click Next.
dsp_transport will appear under Deployments.
Figure 8-3 Install Application Assistant Dialog
Click Activate, then check the box in front of dsp_transport.ear and select Servicing All Requests from the Start drop-down menu. This will complete activation.
Step 4: Import the WSDL for the Data Service
Return to the service bus console and select Project Explorer.
Navigate to your project folder and click either Create or Edit.
Note:
There will be either a Create or an Edit button in the Change Center, depending on whether you are creating a new session or editing an existing one.
Select the project folder or an existing subfolder, or create a new one. For the latter, type a name in Enter New Folder Name under Folders and click Add. The new folder will be added to the tree structure.
Next import the WSDL file that you generated in Step 2. Do this by selecting WSDL under Interface in the Create Resource drop-down menu.
On the panel that appears next, give the resource a name and a description (optional), then click Browse to locate the WSDL file that you generated in Step 2. Select it and click Save. It will then appear as a resource in the Resources table.
For more information, see Adding a WSDL in "Using the AquaLogic Service Bus Console."
Step 5: Create the Business Service
Next, in Create Resources under Resources, select Business Service under Service. In the panel that appears, enter a name for the service in Service Name. For instance, if you had created Customer.wsdl for the sample RTLApp, then you might want to name your business service CustomerBS. Enter an optional description of the service.
Below in the same panel, select WSDL Web Service and click Browse to locate the WSDL file that you imported in Step 4. Click on it. A Select WSDL Definitions panel will appear. Select a binding under Bindings.
If you were running the sample application and had imported Customer.wsdl as described above, you would select CustomerSoapBinding (Figure 8-4).
Figure 8-4 Setting SOAP Binding for WSDL
Click Submit. Then click Next in the main panel.
Under Protocol, select dsp from the drop-down menu. Then enter the Endpoint URI. For Endpoint URI, enter:
t3://<host:port>/<application_name>.
If you were running the RTLApp as described above in the default setup, you would enter:
t3://localhost:7001/RTLApp
Click Add to add the Endpoint URI, then click Next.
Click Next again to accept the defaults. Then on the Create a Business Service - Summary screen that appears, click Save.
The business service should then appear under the table of Resources. If you were creating CustomerBS, it will appear in the table.
The procedure for creating the proxy service is similar to that for creating the business service.
Under Create Resources, select Proxy Service under Service in the drop-down menu.
In the next panel that appears, give your proxy service a name. If you were working with the example, you might want to name it CustomerPS. Provide a description (optional) for the service in Description. Then select Business Service under Create from Existing Service and click Browse. In the screen that appears, select the name of the business service that you created in the previous step. If you had created CustomerBS, as in the example, select CustomerBS. Click Submit, then click Next.
In the next panel, select http in the drop-down menu for Protocol and type in a name for the Endpoint URI. For Endpoint URI you can give it any name you want. Click Next.
In the next two screens click Next to accept defaults, or fill in other values or select other choices.
You will then see a summary screen allowing you to edit your entries. When you are satisfied with your entries, click Save. The proxy service should then appear in the table of resources. If you were working with the example, you should see CustomerPS in the table.
Click Activate, then click Submit.
For more information, see Adding a Proxy Service in "Using the AquaLogic Service Bus Console."
Step 7: Test Your Setup
Reselect the folder where your resources are located, then, under Resources, locate the proxy service you created.
Select Launch Test Console under Actions. The test console should appear. Pick a method under Available Options in the drop-down menu and click Execute. For the RTLApp example, you might select the getCustomer method. In Response Document, you should see a list of customers.
For more information, see Test Console in "Using the AquaLogic Service Bus Console."