Example: Sending a JSON Request Using a REST Web Service Client
Use a JSON request to insert a record into a window in the
ESP project.
Prerequisites
Install the ESP REST
Provider.
Perform all steps outlined in Configuring the SAP Event Stream Processor REST
Provider.
Install and configure a REST Web service client.
Start the ESP Server.
Note You can send gzip format compressed
data HTTP requests to the REST provider by setting the Content-Encoding HTTP
header field to gzip. For example, Content-Encoding: gzip. Ensure
that the request body is encoded with gzip.
Procedure
Use the wsp.bat or wsp.sh script in
%STREAMING_HOME%\wsp to start the
JETTY server and initialize the REST port.
Open the ESP
Studio and create a new project with a name of your
choice.
Double-click the project configuration file
(<yourprojectname>.ccr) to open the CCR Project
Configuration editor. Include the following in your CCL file:
Set the value of the Web Service Enabled option to true in
the Project Deployment Details window.
Save the updated ccr file.
The <yourprojectname>.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.
Send the following JSON request using your REST client: