Configuring OData Server

Before you start OData Server, specify embedded HTTP server options, OData producer options, and database connection parameter settings.

  1. In a text editor, create and open a configuration file called server.properties.
    Sample configuration files are located:
    • $SYBASE/ODATA-16_0/samples/java (%SYBASE%\ODATA-16_0\samples\java in Windows)
    • $SYBASE/ODATA-16_0/samples/dotnet (%SYBASE%\ODATA-16_0\samples\dotnet in Windows)
  2. In the file, specify the options for the embedded HTTP server:
    OptionDescription
    LogFile = path-and-filename

    Specifies the path and file name to which the embedded HTTP server logs OData Producer output.

    The default behavior is to disable logging.

    The path is relative to the location of the server executable.

    LogVerbosity = { 1 | 2 | 3 | 4}
    Higher verbosity levels log additional information and include the information provided by all lower levels. Verbosity level:
    • 1 – returns information about any unexpected errors.
    • 2 – returns general information and configuration messages.
    • 3 – returns detailed information about HTTP requests.
    • 4 – returns debugging messages.
    ServerPort = port-number
    Specifies the port number on which the embedded HTTP server listens. The default setting is 80.
    ShutdownListenerPort = port_number
    Specifies the port number on which the embedded server listens for shutdown requests. The default setting is 2449.
    SSLKeyStore = path-and-filename

    Specifies the path and file name to a Java keystore containing an SSL certificate that the embedded HTTP server uses to encrypt traffic.

    SSL is enabled and unencrypted HTTP traffic is blocked when you specify option.

    The path is relative to the location of the server executable.

    SSLKeyStorePassword = SSLKeyStore-password
    Specifies the password that the embedded HTTP server uses to authenticate against the Java keystore identified by the SSLKeyStore option.
  3. In the file, specify the OData Producer options:
    OptionDescription
    Authentication = {none | database )
    Specifies the credentials used to connect to the database. Valid options are:
    • (Default) database – indicates that users connect with personalized credentials that are appended to the DbConnectionString option to form their own complete database connection string. These credentials are requested using basic HTTP authentication.
    • none – indicates that all users connect using the same connection string, as indicated by the DbConnectionString option.
    ConnectionPoolMaximum = num-max-connections
    Indicates the maximum number of simultaneous connections that the OData Producer keeps open for use in the connection pool.

    The connection pool may use fewer connections depending on the server load. By default, the connection pool size is limited by the number of maximum number of simultaneous connections permitted by the database server.

    DbConnectionString = connection-string
    Specifies the connection string used to connect to the database. The connecting string should exclude the user and password parameters when the Authentication option is set to database.
    DbProduct = ase
    Indicates the type of database server to which the OData Producer connects.
    PageSize = num-max-entities
    Specifies the maximum number of entities to include in a retrieve entity set response before issuing a next link. The default setting is 100.
    Model = path-and-filename

    Specifies the path and file name to the OData Producer service model that indicates which tables and views are exposed in the OData metadata.

    The default behavior is to expose tables and views based on user privileges. Tables and views without primary keys are not exposed.

    The path is relative to the location of the server executable.

    ModelConnectionString = connection-string

    Specifies a connection string that the OData Producer uses to validate the OSDL file during start-up.

    OSDL validation ensures that enlisted tables and columns exist, that key lists are used appropriately, and that the file is semantically correct.

    The connection string should include the user and password parameters.

    The default behavior is to assume that the OSDL file is valid.

    ReadOnly = {true | false}
    Indicates whether modification requests should be ignored. The default setting is false.
    ServiceRoot = url-prefix

    Specifies the URL prefix to append to links in OData responses.

    This setting is required when working with certain proxy configurations, such as reverse proxies.

    The default behavior is to automatically determine the URL prefix, using the data stored in the request.

  4. Specify the database connection parameter settings in the configuration file:
    DbConnectionString = connection-string

    This specifies the connection string used to connect to the database.

    Do not include user or password when you set DbAuthentication to database.

The configuration file should look similar to:
# Embedded HTTP server options
# ----------------------------
ServerPort = 8000
ShutdownListenerPort = 8083
SSLKeyStore = ../../samplekeystore.jks
SSLKeyStorePassword = password
LogFile = ../../odata.log
LogVerbosity = 1

# OData Producer options
# ----------------------
DbAuthentication = none
DbProduct = ASE
MaximumFeedSize = 100
Model = ../../model.osdl
ModelConnectionString = servername:portnumber/dbname?user=yourusername&password=yourpassword
ReadOnly = false
ServiceRoot = localhost:8000/odata/

# Database connection parameters
# ------------------------------
DbConnectionString = servername:portnumber/dbname?user=yourusername&password=yourpassword
Next
After you save the server.properties file, run dbosrv16 to start OData Server with the options you specified in the configuration file:
dbodata server.properties