USER MANUALS

Configuring the RESTful Web Service

This section explains how to configure several settings of the global RESTful web service (i.e. the service at http://denodo-server.acme.com:9090/denodo-restfulws).

This section is not about the settings of REST web services (i.e. services that publish a specific set of views).

Limit the Maximum Number of Rows Returned

You can limit the maximum number of rows returned by the RESTful web service. That is, if this limit is enabled, when a client queries a view, the number of rows in the response will never exceed this limit.

This feature is useful to make sure that there is not any client who puts too much strain on the Virtual DataPort server or its data sources.

To set this limit, follow these steps:

  1. Stop all the Denodo servers. The goal is to make sure the web container is stopped.

  2. Edit the file other_settings.xml of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/

  3. Set the value of the property maximumRowsPerPage to the limit you want to set.

  4. Start the Denodo servers.

Changes to this file will be preserved even when an update of the Denodo Platform is installed.

The Administration Tool provides graphical support to configure this limit on REST web services (the ones that only publish a set of views). The section Settings Tab (REST) explains how to do this.

Cross-origin Resource Sharing (CORS)

The RESTful web service provides support for Cross-origin resource sharing (Cross-Origin Resource Sharing (CORS)). The section Cross-origin Resource Sharing (CORS) (settings of published REST web services) explains in more details what CORS is.

To enable the CORS support on the global RESTful web service, follow these steps:

  1. Do the steps of the section Initial Set-Up of CORS (you have done this already if you published a Denodo REST web service with CORS enabled).

  2. Before starting any server of this Denodo installation, edit the file <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/cors_settings.xml

  3. Uncomment the contents of the file.

  4. If the value of the property is *, the Service will allow CORS requests received from any domain.

    To limit the domains from which CORS requests are allowed, change the value of the property cors.allowOrigin; replace * with the list of allowed URLs. Separate each URL by a comma.

    For example, https://foo.com, http://foo.com, https://foo.bar.com

    CORS requests from any other origin will be denied with the HTTP code 403 (Forbidden)

    Important

    For each URL, enter its protocol as well. URLs that not contain the protocol are invalid. E.g. foo.com is invalid.

  5. Start the Denodo servers.

Changes to this file will be preserved even when an update of the Denodo Platform is installed.

This change only affects the global RESTful web service. If you want to publish REST web services with CORS support, see the section Cross-origin Resource Sharing (CORS) (settings of published REST web services).

Customizing the Look & Feel of the RESTful Web Service

The RESTful web service and the REST web service show the logo of the Denodo Platform at the top.

image0

To replace the Denodo logo with another logo, follow these steps:

Note

This affects the RESTful web service and all the REST web services deployed after doing this change.

  1. Copy the new logo to the directory <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/resources/.

  2. Edit the file stylesheet-customizable.css of the directory <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/resources/

  3. Uncomment the CSS definition div#page-header.

  4. In this definition, replace the URL of the attribute background-image with the URL of the new logo.

    You should end up with a CSS definition similar to this one:

    div#page-header {
       background-image: url('/denodo-restfulws/resources/new_logo.png');
       background-position: top left;
       background-repeat: no-repeat;
       height: 45px;
       padding-bottom: 25px;
       position: relative;
       width: 85%;
       height: 80px;
    }
    

These changes are effective immediately; you do not need to restart. You may need to refresh the cache of the browsers.

Changes to this file will be preserved even when an update of the Denodo Platform is installed.

After following the steps above, all the REST web services that you deploy or redeploy and that do not have its CSS definition customized, will use this new CSS definition. Therefore, they will display the new icon instead of the Denodo one.

Modifying the Connection Parameters Between the RESTful Web Service and Virtual DataPort

As any client of Virtual DataPort, the RESTful web service has its own connection parameters. In most situations, the default connection parameters of the service are fine, but there may be scenarios where you need to change them. For example, let us say that you are going to query views that take a long time to respond. The default query timeout of this service is fifteen minutes. If you think that some queries may take longer, increase it by following these steps:

  1. Stop all the Denodo servers. The goal is to make sure the web container is stopped.

  2. Edit the file connection_settings.xml of the folder <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/.

  3. Increase the value of the property queryTimeout. Note the value of this property is in milliseconds.

    You can also modify other properties of this file if you need to. Each property has a comment above explaining it.

  4. Start the Denodo servers.

Changes to this file will be preserved even when an update of the Denodo Platform is installed.

This change only affects the global RESTful web service. Each REST web service has its own connection parameters.

Important

Do not modify the web.xml of the RESTful web service (that is <DENODO_HOME>/resources/apache-tomcat/webapps/denodo-restfulws/WEB-INF/web.xml) because the next time you install an update of Denodo, this file will be overwritten. You can do changes to the files “connection_settings.xml”, “cors_settings.xml” and “other_settings.xml”; when installing an update, these files are not modified.

Add feedback