Skip Headers
Oracle® Real-Time Decisions Platform Developer's Guide
Version 3.0.0.1

Part Number E13854-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

9 Using the .NET Smart Client

The .NET Smart Client provides a very similar client to the Java API to make calls from your application. With the current implementation, the .NET Smart Client does not have some of the advanced features of the Java Smart Client, including session affinity management and default response handling.

For full information about the .NET Smart Client API, see the Decision Studio online help.

This chapter contains the following topics:

9.1 Before You Begin

You must perform the following tasks first before you can work with the .Net Smart Client:

  1. Install a Java Development Kit (JDK), with the JAVA_HOME environment variable set to its location. To obtain a JDK, go to the Sun Microsystems Web site at http://java.sun.com/products.

  2. Install the Oracle RTD files and deploy Oracle RTD to an application server. See Oracle Real-Time Decisions Installation and Administration Guide for full information.

  3. The .NET Smart Client example works with the sample CrossSell Inline Service. Because of this, you must first populate the Oracle RTD Database with the CrossSell example data, then deploy the CrossSell Inline Service using Decision Studio.

    See Oracle Real-Time Decisions Installation and Administration Guide for information about populating the Oracle RTD Database with the CrossSell example data. See Part III, "Decision Studio Reference" for information about deploying Inline Services.

  4. Start Real-Time Decision Server. For more information, see Oracle Real-Time Decisions Installation and Administration Guide.

9.2 Integrating with an Inline Service Using the .NET Smart Client

In general, the following are the steps for integration:

  1. Create the Oracle RTD Smart Client within your application code.

  2. Create a request directed at an Inline Service and an Integration Point.

  3. Populate the request with arguments and session keys.

  4. Invoke the request using the Smart Client.

  5. If the request is invoked on an Advisor, examine the response.

  6. Close the Smart Client when finished.

The .NET Smart Client is located at RTD_HOME\client\Client Examples\Dot Net Client Example\sdclient.dll. This file should be co-located with your application in order to be accessible.

9.3 .NET Integration Example

You can find an example of a .NET integration client in RTD_HOME\client\Client Examples\Dot Net Client Example\DotNetSmartClientExample.sln. You can open this example in Microsoft Visual C# 2008 Express Edition, then run or debug the example.

In this example, Informant and Advisor Integration Points are invoked on the CrossSell Inline Service. See Section 6.2, "About the CrossSell Inline Service" to familiarize yourself with this Inline Service. In the example, the Integration Points are invoked and the return values from the Advisor are written to the console.

Follow these steps to run the example in Microsoft Visual Studio:

  1. Start Microsoft Visual C# 2008 Express Edition.

  2. From the menu bar, select File > Open > Project.

  3. For File Name, select RTD_HOME\client\Client Examples\Dot NET Client Example\DotNetSmartClientExample.sln and click Open.

  4. If either the host or the port that Real-Time Decision Server is running on is different from the default localhost:8080, perform the following:

    • In the right-hand Solution Explorer window, double-click DotNetSmartClientExample.cs.

    • Locate the following line:

      SDClient client = new SDClient("http://localhost:8080");
      
    • Change localhost:8080 to match the host and port where Real-Time Decision Server is running.

    • Save and close the file.

  5. From the menu bar, select Debug > Start. In the Console window, the following text appears:

    Ring! Ring! New telephone call!
    Enter a customer ID between 1 and 1000:
    
  6. Place the cursor after the colon, then enter a customer ID (such as 5) and press Enter. The response appears similar to the following:

    Here are the deals we've got for you:
     1: ElectronicPayments
      Electronic payments eliminate the complications of handling checks.
    Enter the line number of the offer that catches your interest, or zero if none do:
    
  7. Place the cursor after the final colon, then enter 1 to select the offer. The server responds with a final message.

  8. The process repeats. Press Enter at the Customer ID prompt, without entering a number, to stop the program.