You can deploy and configure the REST gateway for WebSphere eXtreme Scale in a WebSphere
Application Server Classic.
About this task
The REST gateway is a servlet that is defined in the wxsRESTGateway.war web
archive (WAR) file. With this REST gateway, you use a Uniform Resource Identifier (URI) to access
data in the data grid.
Procedure
-
Enable the REST gateway in WebSphere Application Server.
-
Locate the wxsRESTGateway.war file in one of the following locations:
- was_install_root/optionalLibraries/ObjectGrid/restgateway (Note: This file
will not be present if only the WebSphere eXtreme Scale client is installed in the WebSphere
Application Server.)
-
wxs_standalone_install_root/ObjectGrid/restgateway Deploy the
wxsRESTGateway.war file on the WebSphere Application Server.
-
Deploy the wxsRESTGateway.war file on the WebSphere Application
Server.
-
Configure the Catalog Service Domain (CSD) for use by the REST gateway.
-
The Rest gateway will determine the CSD using the following hierarchy:
- CSD corresponding to the context root of the application.
- CSD specified in the ObjectGridServer.properties file (if one exists)
- The CSD defined in the WebSphere Application Server that is marked as default.
- “localhost:2809” none of if none of the above are defined.
- Optional:
Secure your web applications that use this REST gateway.
- Optional:
Configure WebSphere eXtreme Scale client security.
-
Start the web application in the WebSphere Application Server to run the REST client
gateway.
What to do next
You can now begin using the REST data service in Liberty to communicate with the data grid
through a URI. For more information, see Developing data grid applications with the REST gateway. To test the REST
gateway, you can use cURL, or any HTTP client of your choosing. For example:
curl -X POST -k -u <user>:<password>
https://<HOSTNAME>:<PORT>/<contextRoot>/datacaches/<gridname>/<mapname>/<key>
-H “Content-Type: text/plain”
-d “My Text Value”
curl -X GET -k -u <username>:<password>
https://<HOSTNAME>:<PORT>/<contextRoot>/datacaches/<gridname>/<mapname>/<key>