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
- Use the wsp.bat or wsp.sh script in
%STREAMING_HOME%\wsp to start the
JETTY server and initialize the SOAP port.
- Access the ESP SOAP Provider WSDL through http://localhost:<port_number_specified_in_configuration>/espws/services/ESPWebService?wsdl.
- Use the
%STREAMING_HOME%\examples\java\wspexample\project\timeccl.ccl
file to create a new project in the ESP
Studio.
- Double-click the project configuration file (timeccl.ccr) to
open the CCR Project Configuration editor.
- Select the Advanced tab.
- Set the value of the Web Service Enabled option to true in
the Project Deployment Details window.
- 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.
- 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.
- 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
- Check Studio to see the records get published to the InputWindow1 window
using the Web services interface.
- Read the com.sybase.esp.wsp.example.ESPExample.java file and extend or
write your own test cases accordingly.
- 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:
<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" />
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" >