Show TOC

Example: Using a Sample Client to Connect to the SAP Event Stream Processor SOAP ProviderLocate this document in the navigation structure

Use the files in the %STREAMING_HOME%\examples\java\wspexample directory to run a sample client to connect to the ESP SOAP Provider.

Prerequisites

  • Install the ESP SOAP Provider.
  • Perform all steps outlined in Configuring the SAP Event Stream Processor SOAP Provider.
  • Start the ESP Server.

Procedure

  1. Use the wsp.bat or wsp.sh script in %STREAMING_HOME%\wsp to start the JETTY server and initialize the SOAP port.
  2. Access the ESP SOAP Provider WSDL through http://localhost:<port_number_specified_in_configuration>/espws/services/ESPWebService?wsdl.
  3. Use the %STREAMING_HOME%\examples\java\wspexample\project\timeccl.ccl file to create a new project in the ESP Studio.
  4. Double-click the project configuration file (timeccl.ccr) to open the CCR Project Configuration editor.
  5. Select the Advanced tab.
  6. Set the value of the Web Service Enabled option to true in the Project Deployment Details window.
  7. Save the updated ccr file.
    The timeccl.ccr file now has an entry, <Option name="ws-enabled" value="true"/>, to show that Web service accessibility is enabled.
  8. If the project is started, for the changes to take effect, use Studio or streamingclusteradmin to stop and remove the project from the node, then redeploy (add) the project. Or restart the cluster on which the project runs.
  9. Run the example com.sybase.esp.wsp.example.WSPExample from the %STREAMING_HOME%\examples\java\wspexample\src directory.
    Windows:
    java -cp .;%STREAMING_HOME%\libj\streaming-client.jar;..\libs\axis.jar;..\libs\jaxrpc.jar;..\libs\commons-discovery-0.2.jar;..\libs\commons-logging-1.1.jar;..\libs\commons-lang-2.6.jar com.sybase.esp.wsp.example.WSPExample
    UNIX:
    java -cp .:$STREAMING_HOME/libj/streaming-client.jar:../libs/axis.jar:../libs/jaxrpc.jar:../libs/commons-discovery-0.2.jar:../libs/commons-logging-1.1.jar;../libs/commons-lang-2.6.jar com.sybase.esp.wsp.example.WSPExample
  10. Check Studio to see the records get published to the InputWindow1 window using the Web services interface.
  11. Read the com.sybase.esp.wsp.example.ESPExample.java file and extend or write your own test cases accordingly.
  12. Compile updated code:
    javac -cp .;%STREAMING_HOME%\libj\streaming-client.jar;..\libs\axis.jar;..\libs\jaxrpc.jar;..\libs\commons-discovery-0.2.jar;..\libs\commons-logging-1.1.jar;..\libs\commons-lang-2.6.jar com/sybase/esp/wsp/example/WSPExample.java
    Here are functions provided with the ESP SOAP Provider:
    • getVersion - obtain the version and last updated date for the ESP Web Services Provider
    • getSchema - obtains the schema string for the ESP project of your interest
    • publish - publishes stream data to ESP projects
    The publish function only accepts incoming data row in these formats:
       &lt;InputWindow1 ESP_OPS=&quot;i&quot; C_KEY=&quot;0&quot;
    C_TIMESTAMP=&quot;1970-01-01 12:12:00.000&quot; /&gt;
    	&lt;InputWindow1 ESP_OPS=&quot;u&quot; C_KEY=&quot;1&quot;  
    C_TIMESTAMP=&quot;1970-01-01 12:12:00.000&quot; /&gt;
    The rows above are escaped forms for these ESP XML format records:
    <InputWindow1 ESP_OPS="i" C_KEY="0" C_TIMESTAMP="1970-01-01 12:12:00.000" >
    <InputWindow1 ESP_OPS="u" C_KEY="1" C_TIMESTAMP="1970-01-01 12:12:00.000" >