Remote Service Entries in the c8-services.xml File

The c8-services.xml file requires a section for every remote service before you can use the service in a CCL query.

Your specific service entry depends on the RPC plugin and remote procedure you are using. All remote service entries, however, require the following information:

The names of the initialize, execute and shutdown function calls within the .dll or .so.

Optionally, the service entry may also include the names and functions of configuration parameters for the functions in the RPC plugin (for example, the HTTP URL of the RPC server). See the Sybase CEP Integration Guide for more information about the RPC plugin name, its initialize, execute and shutdown calls and its optional parameters.

The c8-services.xml file contains an example of a remote service entry, using the SOAP RPC plugin. The Sybase CEP Integration Guide includes a detailed description of the example plugin. You can use the example plugin to send two zip codes to an RPC server and receive the distance between these two zip codes. You can also use the SOAP RPC plugin section of the c8-services.xml file to create a service entry for your own RPC plugin.

To create a service entry for your plugin, make a copy of the SOAP RPC plugin section within the c8-services.xml file and replace the values as explained in this section.

<Service Name="GetZipCodeDistance"1 Type="REMOTESERVICE"2>
<Description>
 Computes the distance between two US zip codes.
</Description>3
<!-- RPC Plugin -->
<Param Name="RpcLibrary">c8_rpc_http_soap_lib4</Param>
<Param Name="RpcInitCallback">c8_rpc_soap_initialize5</Param>
<Param Name="RpcExecuteCallback">c8_rpc_soap_execute6</Param>
<Param Name="RpcShutdownCallback">c8_rpc_soap_shutdown7</Param>
<!-- SOAP/RPC Plugin -->
<Param Name="HttpURI">8http://teachatechie.com/GJTTWebservices/ZipCode.asmx
</Param>
<Param Name="HttpTimeout">50</Param>
<Param Name="HttpKeepAlive">true</Param>
<Param Name="HttpEnableLogging">true</Param>
<Param Name="SoapURI">http://teachatechie.com/</Param>
<Param Name="SoapMethod">GetDistance</Param>
<Param Name="SoapAction">
 "http://teachatechie.com/GetDistance"
</Param>
</Service>
  1. Provide a unique service name for the remote service in the "Service Name" preference on this line. This name is case-sensitive, must begin with a letter and may contain letters, digits, underscores, dots and/or colons. The service name must be the same name as the name of the remote service you use in your CCL queries.
  2. Set the "Type" preference on this line to REMOTESERVICE.
  3. (Optional). Add a description of your service entry in the "Description" element.
  4. Set the "RpcLibrary" preference on this line to the name of the library used by your RPC plugin. For the Sybase CEP SOAP and HTTP RPC plugin, use c8_rpc_http_soap_lib.

    When specifying the library name:

    • Do not include the .dll or .so file name extension. Sybase CEP Server adds the appropriate extension automatically. On UNIX-like operating systems, Sybase CEP Server also adds a lib prefix (such as in libc8_rpc_http_soap_lib.so) if necessary.

    • Do not specify the library path. Both Microsoft Windows and UNIX-like operating systems automatically search for the library in the default library locations for the operating system.

  5. Set the "RPCInitCallback" preference on this line to the name of the initialize function used by the plugin. If you are using the SOAP RPC plugin, the initialize function is c8_rpc_soap_initialize. For the HTTP RPC plugin, use c8_rpc_http_initialize.
  6. Set the "RPCExecuteCallback" preference on this line to the name of the execute function used by the plugin. If you are using the SOAP RPC plugin, the execute function is c8_rpc_soap_execute. For the HTTP RPC plugin, use c8_rpc_http_execute.
  7. Set the "RPCShutdownCallback" preference on this line to the name of the shutdown function used by the plugin. If you are using the SOAP RPC plugin, the shutdown function is c8_rpc_soap_shutdown. For the HTTP RPC plugin, use c8_rpc_http_shutdown.
  8. Optionally, use this and subsequent lines to specify plugin configuration parameters used by the plugin's functions. Here is a list of the configuration parameters used by the SOAP and HTTP RPC plugins. For detailed information regarding the configuration parameters available with the SOAP and HTTP RPC plugins, see the Sybase CEP Integration Guide .

    HttpURI

    The HTTP URI to which the plugin should send the request.

    HttpTimeout

    The HTTP connection timeout.

    HttpKeepAlive

    The service should use keep-alive connections.

    HttpEnableLogging

    The service should log arguments and return values for all plugin calls.

    SoapURI

    The URI of the SOAP resource.

    SoapMethod

    The name of the SOAP method to call.

    SoapAction

    The SOAPAction HTTP header.

You can also configure the remote service entry for a number of additional settings, as described in "Setting Optional Preferences for Services".