Show TOC

Create REST Handler ClassLocate this document in the navigation structure

After executing SAP transaction SE24, create a class and assign the interface IF_HTTP_EXTENSION to this new class. The only method you have to implement is HANDLE_REQUEST()

Methods

Method HANDLE_REQUEST

This method is called for request handling for processing each incoming HTTP request.

Parameter

Description

SERVER

Process an incoming HTTP request

  1. Create two instance objects of the REST request and response classes by calling

    cl_rest_message_builder=>create_http_request and

    cl_rest_message_builder=>create_http_response

  2. Create the framework logger object and turn on the logger. If CSRF token is supported, the handling CSRF token method (HANDLE_CSRF_TOKEN()) has to be called.
    Note The token method can be overridden to support specific cases, such as the external tool cannot handle SAP token.
  3. The framework feature service handler object of type reference to cl_gef_service_handler has to be created by calling cl_gef_service_factory=>create with the newly defined GIS provider type, which is the same as your GIS service.
  4. 4. In the end, method set_response() is called to send the response back to the service requester. Again set_response() can be overridden to introduce some other features, such as CORS, JSONP, etc. For details, please refer to Support Cross-Origin Requests (Optional)

To summarize, in order to create a new REST service handler class, make a copy of the class CL_GEF_ESRI_REST_HANDLER, and then define a GIS type constant, which is the same as your GIS service provider name defined in the Customizing activity Customizing Services for the GIS Provider. At the end, replace iv_gis_type with your new constant type name in method call cl_gef_service_factory=>create.

For more information, see Developing a HTTP Request Handler