# Tutorial: Java Control

## The Big Picture

The Java control tutorial is the first in a series of three tutorials that builds the Investigate Application, an application designed to assemble a credit-worthiness report on loan applicants. (Note: you do not need to execute the tutorial series in order. You may skip ahead to the web services tutorial or page flow tutorial if you wish.)

This, the first tutorial in the series, builds the core of the application: the Investigate Java control. The Investigate Java control consults a variety of components to assemble the credit-worthiness report. The Investigate Java control and its components are shown in blue in the diagram to the right. The remaining two tutorials focus on different ways to access the core functionality encapsulated by the Investigate Java control.

The second tutorial in the series, Tutorial: Web Service, builds the web services tier of the application.

The third tutorial in the series, Tutorial: Page Flow, builds a web-based user interface for the Investigate Application.

### Tutorial Goals

Through this tutorial, you will learn how to create and test a Java control with WebLogic Workshop. Along the way, you will also learn how to create methods that expose a control's functionality, become acquainted with WebLogic Workshop's support for asynchronous communication and loose coupling, and learn how to use WebLogic Workshop's built-in Java controls to help you connect to backend resources and to speed the design process.

### Tutorial Overview

The Java control you build with this tutorial collects credit-related information about a loan applicant, computes a credit worthiness score, and returns the combined information to the client.

There are six actors in this scenario:

- The clients of your Java control. Clients of Investigate are loan or credit application processing systems. An example might be a credit card application processing system at a department store. These systems will use Investigate to determine the applicant's credit worthiness. They will supply you with the applicant's taxpayer ID, and your control will compute and return a credit score.
- The Investigate Java control. Investigate receives a taxpayer ID as part of requests from clients and respond with information about the applicant's credit worthiness.
A credit card reporting web service with information about the applicant's credit history. You should imagine that that the credit card reporting web service is an external application accessible over the internet. But for the purposes of the tutorial, this web service will deployed on the same server as the Investigate Java control.
- A database containing bankruptcy information about credit applicants.
- A credit scoring application, exposed through the Java Message Service (JMS), designed to calculate a credit score based on information you've collected.
- An Enterprise Java Bean (EJB) designed to provide a credit rating based on the score.

This tutorial guides you through the process of adding functionality in increments, and shows you how to test your Java control as you build it.

### Steps in This Tutorial

Step 1: Begin the Investigate Java Control — 25 minutes

In this step you build and run your first WebLogic Workshop Java control. You start WebLogic Workshop and WebLogic Server, then create the access points clients use to request and retrieve credit reports.

Step 2: Add a Database Control — 20 minutes

You add a control for access to a database, then query the database for bankruptcy information.

Step 3: Add a Web Service Control — 25 minutes

You use a Web service control to invoke another web service, collecting credit card data on the applicant. This step also uses XMLBeans to parse the response from the Web service.

Step 4: Add a JMS Control — 20 minutes

You will take the data you have gathered and request help from an in-house application to retrieve a credit score.

Step 5: Add an EJB Control — 20 minutes

You will send the credit score to an Enterprise Java Bean (EJB) that will use it to measure the applicant's credit risk.

Step 6: Add Support for Cancellation and Exception Handling — 20 minutes

You enhance Investigate to handle a client's desire to cancel the request, an overly long wait for a response from the credit card service, and exceptions thrown from your service's methods.

Step 7: Security — 20 minutes

You modify the Investigate Java control so it can access a web service over SSL (Secure Socket Layer).

Step 8: Compile the Java Control and Add a Property — 25 minutes

You add a property to the Investigate Java control so that developers using the control can change the way it functions and you package the control as a JAR file for general distribution.

Summary: Java Control Tutorial

You review the concepts and technologies covered in the tutorial. This step provides additional links for more information about each area covered.

To begin the tutorial, see Step 1: Begin the Investigate Java Control.

Click the arrow to navigate to the next step.