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 Liquid Data 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 Liquid Data data services layer.
Figure 6-1 Web Service Clients
To expose data services through a web service interface, add the Liquid Data 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 Liquid Data 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 Liquid Data control to an existing Web Service file (.jws
), perform the following steps:
Figure 6-2 Adding a Liquid Data Control to a Web Service
Figure 6-3 Insert Control Wizard
.jcx
) file is generated, with a call for each selected function. The LiquidDataControl.jar
file is copied into the Libraries
directory of your application when you finish creating the Liquid Data Control.
Figure 6-4 Liquid Data Control Wizard—Select Queries
Figure 6-5 Adding a Function to the Web Service
From there, you can work with the Liquid Data 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 Liquid Data Control. You can create either conversational or stateless web services with data service. The following instructions describe how to create a conversational web service.
.jcx
) file, right-click, and select Generate Stateless JWS File. Workshop generates the .jws
Java Web Service file for your Liquid Data control. startTestDrive
and finishTestDrive
methods, as well as a method for each of the queries you specified in the Liquid Data 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.
![]() ![]() |
![]() |
![]() |