CreditReport.jws Sample

Similar to the Investigate web service developed during Tutorial: Your First Web Service, but more fully developed. Demonstrates use of conversations and Service controls.

# Concepts Demonstrated by this Sample

- Use of a Timer control

- Use of a Service control

- Declaration and use of a client callback

- Use of the JwsContext interface

- Use of Conversations

- Use of XML maps

- Polling

# Location of Sample Files

This sample is located in the creditreport folder of the samples WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic700\samples\workshop\applications\samples\creditreport\CreditReport.jws

# How to Run the Sample

To run this web service:

1. Start WebLogic Server in the appropriate domain.

   - On Microsoft Windows systems, from the Start menu navigate to:

   BEA WebLogic Platform 7.0->WebLogic Workshop->WebLogic Workshop Examples->Start Examples Server.

   - On Linux or Solaris systems, run:

   BEA_HOME/weblogic700/samples/workshop/startWebLogic.sh

2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/creditreport/CreditReport.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine, you may click here to run the sample.

3. Navigate to the Test Form tab of Test View, if necessary.

4. Enter any numeric value for ssn and invoke the requestReport method.

5. If you click Refresh, log entries for calls to the two external services will appear, to bank.startCustomerAnalysis and irs.requestTaxReport.

6. After 10 seconds, bank will report back by sending the onDeliverAnalysis callback. The partial results will be forwarded to the client with an invocation of CreditReport's onProgressNotify callback. You must continually click Refresh to see method invocations on controls and callbacks because there is no way to push these events to a browser.

7. At any time, you may navigate to the continue methods for CreditReport by clicking on the conversation ID in the Message Log.

8. After 20 seconds, the irs service control will respond. Another onProgressNotify callback is sent to the client, then finally a onReportDone callback ends the conversation.

9. At any time before the conversation ends you may invoke getCurrentStatus.

10. At any time before the conversation ends you may invoke cancelReport, which will in turn invoke cancel methods on the external services if they are still pending.

11. Select log entries in the log to see the message traffic involved in each interaction.

Related Topics

Controls: Using Resources from a Web Service

Timer Control: Using Timers in Your Web Service

Service Control: Using Another Web Service

Maintaining State with Conversations

Using Polling as an Alternative to Callbacks

JwsContext Interface