Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Configuring the Web Service Provider (WSP) for use with SDS Projects

Configuring the WSP to Use REST Posts

When performing a custom installation of smart data streaming, the installer sets cluster parameters in wsp.xml to the values provided during setup. We will be editing this file to ensure it matches what is required to use REST Posts.

In the %STREAMING_HOME%\wsp\wsp.xml (Windows) or $STREAMING_HOME/wsp/wsp.xml (Unix) file:

     1. Set the value of the “enabled” attribute of the webService tag to “true”: <webService enabled="true">

     2. Set the value of the protocol tag to “http” or “https”: <protocol>http</protocol>.

     3. Within the webService tag, set the resPort tag value. The default REST port is 9091 and this value will be used in this tutorial.

The webService tag in your wsp.xml file should look something like what follows at this point:

<webService enabled="true">

                                …

                                <restPort>9091</restPort>

                                <protocol>http</protocol>

...

     4. If you are using HTTPS, specify the keystore type, file, and password in the <Security> section. If you are using HTTP, this section is ignored.

Configuring the Web Service Provider to Use WebSockets

When performing a custom installation of smart data streaming, the installer sets cluster parameters in wsp.xml to the values provided during setup. We will be editing this file to ensure it matches what is required to use WebSockets.

In the %STREAMING_HOME%\wsp\wsp.xml (Windows) or $STREAMING_HOME/wsp/wsp.xml (Unix) file:

Enable the smart data streaming Web Services Provider by setting the enabled attribute of the webService tag to “true”: <webService enabled="true">.

     1. Set the value of the “enabled” attribute of the webService tag to “true”: <webService enabled="true">

     2. Set the value of the protocol tag to “http” or “https”: <protocol>http</protocol>.

     3. Enable the smart data streaming WebSocket Provider by setting <webSocket enabled="true">.

Your wsp.xml file should look something like what follows at this point:

<webService enabled="true">

                …

                <protocol>http</protocol>

                <webSocket enabled="true">

                                <webSocketPort>9092</webSocketPort>

                …

...

     4. Set properties for the WebSocket Provider within the section (optional. the default values will work fine):

Property

Description

<webSocketPort>

(Required) Specify the port of the WebSocket provider. The default WebSocket port is 9092.

<secured>

(Required) Specify whether to use HTTP or HTTPS as the protocol. If set to true, the protocol is HTTPS.

<publishSocketLoading>

(Required) Specify the maximum number of remote connections that can publish data over a single connection to smart data streaming.

<subscribeSocketLoading>

(Required) Specify the maximum number of remote connections that can subscribe to data over a single connection from smart data streaming.

     5. If you are using HTTPS, specify the keystore type, file, and password in the <Security> section. If you are using HTTP, this section is ignored.

Running the WSP

                In order to start the WSP, you must run the wsp.bat or wsp.sh script in the %STREAMING_HOME%\wsp (Windows) or $STREAMING_HOME\wsp (Unix) directory (which initializes both SOAP and REST ports). Before doing so, however, make sure that the JAVA_HOME environment variable is set to the jre installation included in the SDS installation. In Unix, the following command can be used:

JAVA_HOME=$STREAMING_HOME/lib/jre

This is important as the Java Runtime Environment is used to run the WSP.

                When running the WSP, it is generally ideal to start the process in the background and have it continue to run when logged out. Running the following command will achieve this:

nohup $STREAMING_HOME/wsp/wsp.sh&

Note: all output will be redirected to the $STREAMING_HOME/wsp/nohup.out file.