Web Service connectors for input and output in Opportunity Detect

You can use a Web Service Connector for incoming transaction data, for Outcome data, or for both.

To use the Web Service Connector for either input or Outcome data, your organization must develop Java classes.

  • When you specify the Web Service Connector for incoming transaction data, you develop a Java class that sends the data to an API over HTTP.
  • When you specify the Web Service Connector for Outcome data, you develop a Java class that implements an interface provided by a servlet. You can write the Outcome data to a file, to a database, or you can develop your plugin to act like a web service.

This section provides the details required for this development effort.

Example use case

Here is an example of how a telephone company might use the Web Service connector for both input and Outcome data.

  • A customer makes a call on her cell phone while on vacation.
  • A call data record is sent to the Web Service connector.
  • Opportunity Detect processes the transaction and detects an unusual event, in this case a call from outside the customer's data plan area.
  • Opportunity Detect sends the Outcome data to two Web Service plugins.
    • One plugin updates profile variables used by Interact.

      This data improves the customer profile that Interact uses to evaluate effective offers when the customer visits the company's web site or calls customer service.

    • Another plugin alerts a company system, which sends an SMS offer to the customer's phone.

      For example, the message might offer to upgrade her data plan.

Block diagram

The following diagram illustrates the Web Service connector.

Block diagram of web service connector.

Location of the input jar files and the output class and plugin

All of the locations described in this section are under the run time installation of Opportunity Detect.

  • For input, your Java application must use the RealTimeClient.jar file, located here:

    RealTimeConnector/wlp/usr/servers/RealTimeConnector/dropins/RealTimeConnector/WEB-INF/client

    The following dependent .jar files must be included in the Java class path of your application. They are in the same location as the RealTimeClient.jar file.

    • JSON4J.jar
    • log4j.jar
  • For Outcomes, your Java application must use the StreamServletRealTimePlugin class, located here:

    RealTimeConnector/wlp/usr/servers/RealTimeConnector/dropins/RealTimeConnector/WEB-INF/classes/com/ibm/unica/detect/interact/servlet

    Place the plugin you develop here:

    RealTimeConnector/wlp/usr/servers/RealTimeConnector/dropins/RealTimeConnector/WEB-INF/lib

Timestamp format

Timestamps in input data must be expressed in milliseconds.

Data types

No objects are used for either input or Outcomes using the Web Service connector. Only primitive data types are used.

Locale

Locale is handled by the Opportunity Detect engine.

Monitoring

Because Opportunity Detect is built on Streams, you can use the built-in monitoring capabilities of the Streams server to monitor processing. See the Streams documentation for details.