Client Application Developer's Guide
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
This chapter describes how to expose data services as standard web services. It covers these topics:
Using WebLogic Workshop and a BEA AquaLogic Data Services Platform (DSP) control, you can easily add a web service wrapper to a data service. Doing so gives your data services the benefits of standard web service features, including loose client/server coupling, UDDI capability and WS-Security. WS-Security is particularly useful because it provides encryption-based, message-level security for your data.
Exposing data services as web services can make your data service information accessible to a wide variety of client types including other web services, .NET, or any non-Java application. Figure 6-1 illustrates the relationship between these client types and the DSP services layer.
Figure 6-1 Web Service Clients
To expose data services through a web service interface, add a data service control to a web service project in WebLogic Workshop. Then add data service functions from the control to your web service. The web service function needs only to pass through the results of the data service function, as shown in the following sample of generated code:
public class myCustomerWS implements com.bea.jws.WebService {
...
public dataServices.payments.CustomerDocument getCustomer(int p0) {
return customerDsCtrl.getPayments(getCustomer(p0)); }
}
You can then generate a WSDL from the web service by right-clicking on the WSDL (.jws
file). Once deployed, the data service function can be used from clients applications just like any other web service deployed to the WebLogic server. Keep in mind that data is returned from DSP as standard SOAP-encased XML data, not as service data objects.
Note: This chapter focuses on how to expose data services through a standard web service interface. For more information on consuming WebLogic web services, see Invoking Web Services in Programming WebLogic Web Services in the WebLogic Platform documentation.
To add a data service control to an existing Web Service file (.jws
), perform the following steps:
Figure 6-2 Adding a Data Service Control to a Web Service
Figure 6-3 Insert Control Wizard
The LiquidDataControl.jar
file is copied into the Libraries
directory of your application when you finish creating the data service control.
Figure 6-4 Data Service Control Wizard—Select Queries
Figure 6-5 Adding a Function to the Web Service
From there, you can work with the Data Services Platform web service as you can any other web service in WebLogic Workshop. You can generate a WSDL file for it, and more.
For example, to create a WSDL file, right-click the JWS file in the application tree and choose Generate WSDL File from the menu.
Perform the following steps to generate and test a web service from a data service control. You can create either conversational or stateless web services with data service. The following instructions describe how to create a conversational web service.
.jws
Java Web Service file for your data service control. startTestDrive
and finishTestDrive
methods, as well as a method for each of the queries you specified in the data service control wizard. Once deployed, the web service can be used just like any other web service deployed on WebLogic servers. For more information, see Invoking Web Services in Programming WebLogic Web Services in the WebLogic Server documentation.
![]() ![]() |
![]() |
![]() |