Top
Interstage Big Data Complex Event Processing Server V1.0.0 User's Guide
Interstage

5.5.3 Developing a Collaboration Application

This section explains how to develop a collaboration application, as follows:

5.5.3.1 Developing an Event Sender Application

Develop an application to send events to the CEP engine.

Develop the application according to the type of input adapter to be used.

Refer to Chapter 3, "Input Adapter Reference" in the Developer's Reference for information on sample programs by input adapter type.

5.5.3.2 Developing a User-developed Web Service

Develop a Web service application to be called from the SOAP listener.

5.5.3.2.1 Web service development procedure

This section explains the Web service development procedure.

  1. Create a WSDL.

    Create a WSDL (interface definition) for a user-developed Web service from the interface information (Web service URL, namespace, prefix, and method) of the Web service to be called, that was defined in the SOAP listener definition, and from the parameters that are specified in the complex event processing statements (SELECT statements).

    Below is an example of the association between the complex event processing statement (SELECT statement) for detecting the target events, the SOAP listener definition associated with that rule, and SOAP messages generated from the SOAP listener.

    Figure 5.5 Association between a rule definition, listener definition, and SOAP messages to be sent

    A sample WSDL for a Web service for receiving these SOAP messages is shown below. This WSDL defines a message receive-only (one-way) Web service. If it is implemented as a Web service that returns a response to the CEP engine (request-response), the CEP engine ignores this response.

    Table 5.2 Sample WSDL
    001
    002

    003

    004

    005

    006

    007

    008

    009

    010

    011

    012

    013

    014

    015

    016

    017

    018

    019

    020

    021

    022

    023

    024

    025

    026

    027

    028

    029

    030

    031

    032

    033

    034

    035

    036

    037

    038

    039

    040

    041

    042

    043

    044

    045

    046

    047

    048

    049

    050
    <?xml version='1.0' encoding='UTF-8'?>
    <definitions

    targetNamespace="
    http://example.com/exampleNamespace"
    xmlns="http://schemas.xmlsoap.org/wsdl/"

    xmlns:tns="
    http://example.com/exampleNamespace"
    xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">


    <types>

    <xs:schema elementFormDefault="qualified"

    targetNamespace="
    http://example.com/exampleNamespace" >
    <xs:element name="
    rootElement">
    <xs:complexType>

    <xs:sequence>

    <xs:element name="
    property1" type="xs:string" />
    <xs:element name="
    property2" type="xs:string" />

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    </xs:schema>

    </types>


    <message name="notifyMessage">

    <part name="body" element="tns:
    rootElement" />
    </message>


    <portType name="eventReceiverPortType">

    <operation name="notifyOperation">

    <input message="tns:notifyMessage" />

    </operation>

    </portType>


    <binding name="eventReceiverSOAP
    Binding" type="tns:eventReceiverPortType">
    <soapbind:binding transport="http://schemas.xmlsoap.org/soap/http"

    style="document" />

    <operation name="notifyOperation">

    <soapbind:operation soapAction="" />

    <input>

    <soapbind:body use="literal" />

    </input>

    </operation>

    </binding>


    <service name="eventReceiverService">

    <port name="eventReceiverSOAP
    Port" binding="tns:eventReceiverSOAPBinding">
    <soapbind:address location="
    http://example.com/serviceEndPoint" />
    </port>

    </service>

    </definitions>

    Modifying, as follows, the underlined parts according to a rule definition or SOAP listener definition allows the WSDL above to be used to generate a template of the Web service to be created:

    • Line numbers 003, 005, and 011

      Use the value of the namespace in the SOAP listener definition as the target namespace of the WSDL ("targetNamespace" attribute of the "definitions" element), the declaration of the target namespace prefix ("xmlns:tns" attribute of the "definitions" element), and the target namespace of the XML schema in the WSDL ("targetNamespace" attribute of the "xs:schema" element in the "types" element).

    • Line numbers 012 and 025

      Use the value of the root element in the SOAP listener definition as the name of the root element of messages to be defined in the XML schema in the WSDL ("name" attribute of the "xs:element" element in "xs:schema" element in the "types" element) and the element defined as a message of the WSDL ("element" attribute of the "part" element in the "message" element).

    • Line numbers 015 and 016

      Use the output property name of the complex event processing statement (SELECT statement) as the name of the subelement of the root element to be defined in the XML schema in the WSDL ("name" attribute of the "xs:element" element under the root element definition in the "types" element).

      Create as many similar lines as the number of properties to be output. In the example above, this element type ("type" attribute of the "xs:element" element) is specifying a string ("xs:string"). Setting this to suit the property type will, depending on the tool used, generate source code according to the type, so type conversion will no longer be required in the program.

    • Line number 047

      In the final WSDL for service publishing, the actual URL of the service will be entered in the "location" attribute of the "soapbind:address" element under the "service" element, and this will also be the value of the connection URL in the listener definition. However, this connection URL is often unsure at development, so there is no problem with leaving it as in the sample above.

  2. Develop the Web service application.

    Based on the created WSDL, output a template for the Web service application from the development tool being used, and then add the application logic to it.

5.5.3.3 Developing an Event Log Analysis Application

Develop an application to analyze event logs. Develop the application using the Hadoop API. Refer to the Interstage Big Data Parallel Processing Server manuals for details.

5.5.3.4 Developing a Cache Access Application for Update

Develop a cache access application. Refer to the Interstage eXtreme Transaction Processing Server manuals for details.