Database connection parameters, embedded HTTP server options, and OData Producer options must be configured in a configuration file. Specify this file on the command line when you start the OData Server.
The following embedded HTTP server options can be specified in the configuration file:
Option | Description |
---|---|
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 } |
Specifies the verbosity level of the logs. Higher verbosity levels log additional information and include the information provided by all lower levels. Verbosity level 1 outputs information about any unexpected errors. Verbosity level 2 outputs general information and configuration messages. Verbosity level 3 outputs detailed information about HTTP requests. Verbosity level 4 outputs debugging messages. |
ServerPort = port-number |
Specifies the port number on which the embedded HTTP server should listen. The default setting is 80. |
ShutdownListenerPort = port-number |
Specifies the port number on which the embedded HTTP server should listen for shutdown requests. The default setting is 2449. |
SSLKeyStore = path-and-filename |
Specifies the path and file name to a Java Key Store containing an SSL certificate that the embedded HTTP server uses to encrypt traffic. SSL is enabled and unencrypted HTTP traffic is blocked when this option is specified. 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 Key Store identified by the SSLKeyStore option. |
The following OData Producer options and connection parameter settings can be specified in the configuration file:
Option | Description |
---|---|
Authentication = { none | database } |
Specifies the credentials used to connect to the database. The default setting, database, indicates that each user connects 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. The none setting 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. Fewer connections may be used by the connection pool depending on the server load. By default, the connection pool size is limited by the maximum number of simultaneous connections that are permitted by the database server. |
DbConnectionString = connection-string |
Specifies the connection string used to connect to the database. The connecting string should exclude the UID and PWD parameters when the Authentication option is set to the database. |
DbProduct = sqlanywhere | 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 of an OData Service Definition Language (OSDL) file that contains the OData Producer service model indicating 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 startup. 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 UID and PWD 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 = / path-prefix |
Specifies the root of the OData service on the OData Server. The default setting is /odata. All resources for this OData Producer are accessed using URIs of the following format: scheme:host:port/path-prefix/resource-path[query-options] For example: http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name |
The following sample illustrates how to format a configuration file for use with the OData Server:
# Embedded HTTP server options # ---------------------------- LogFile = ../../odata.log LogVerbosity = 1 ServerPort = 8000 ShutdownListenerPort = 8083 SSLKeyStore = ../../samplekeystore.jks SSLKeyStorePassword = pwd # OData Producer options # ---------------------- Authentication = none ConnectionPoolMaximum = 10 DbProduct = sqlanywhere Model = ../../model.osdl ModelConnectionString = uid=dba;pwd=sql;eng=orderentry;dbf=orderentry.db PageSize = 100 ReadOnly = false ServiceRoot = /odata/MyProducer # Database connection parameters # ------------------------------ DbConnectionString = uid=dba;pwd=sql;eng=orderentry;dbf=orderentry.db |
Save the file as server.properties and then run the following command to start the OData Server with the options specified in that configuration file:
dbosrv16 server.properties |
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |