Deploying the REST gateway on WebSphere Application Server Classic

You can deploy and configure the REST gateway for WebSphere eXtreme Scale in a WebSphere Application Server Classic.

Before you begin

Install WebSphere® eXtreme Scale on WebSphere Application Server. For more information, see Installing WebSphere eXtreme Scale or WebSphere eXtreme Scale Client with WebSphere Application Server.

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

  1. Enable the REST gateway in WebSphere Application Server.
    1. 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.
    2. Deploy the wxsRESTGateway.war file on the WebSphere Application Server.
  2. Configure the Catalog Service Domain (CSD) for use by the REST gateway.
    1. 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.
  3. Optional: Secure your web applications that use this REST gateway.
    For more information, see Securing web applications.
  4. Optional: Configure WebSphere eXtreme Scale client security.
  5. 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>