CustomerDataTest.jws Sample
This topic inludes the source code for the CustomerDataTest.jws Sample.
Sample Location
This sample is located in the following directory in your WebLogic Workshop installation:
BEA_HOME/weblogic81/samples/workshop/ExtensionDevKit/ControlDevKit/ControlTest/featuresTests/
Sample Source Code
01 package featuresTests;
02
03 import com.bea.control.JwsContext;
04 import java.util.HashMap;
05 import java.util.ArrayList;
06
07 /*
08 * This web service provides a way to test the CustomerData control.
09 * By specifying a customer ID as an attribute of that control,
10 * you can use the control to query a database for information about
11 * the customer.
12 *
13 * The control illustrates how to implement an attribute editing/validation
14 * dialog. To see this control's dialog in use, click the control in
15 * Design View, then click the ... for the customer-id attribute.
16 */
17 public class CustomerDataTest implements com.bea.jws.WebService
18 {
19
20 /**
21 * @common:control
22 * @jc:customer-db customer-id="987659"
23 */
24 private propEditor.CustomerData thisCustomer;
25
26 /**
27 * Returns the customers name.
28 *
29 * @common:operation
30 */
31 public String getCustName()
32 {
33 return thisCustomer.getCustomerName();
34 }
35
36 /**
37 * Returns the list of items the customer has purchased.
38 *
39 * @common:operation
40 */
41 public ArrayList getItemsPurchased()
42 {
43 ArrayList results = new ArrayList();
44 ArrayList items = thisCustomer.getItemsOrdered();
45 return items;
46 }
47 }
|