Connecting to Local Files
Set the URI to an XML or JSON file. Below is an example connection string:
Connecting to HTTP JSON or XML Streams
Set the URI to the HTTP or HTTPS URL of the XML or JSON resource you want to access as a table. Set AuthScheme to use the following authentication types.
- HTTP: To use HTTP Basic or Digest, set the User and Password and set the corresponding AuthScheme. Set CustomHeaders if you need access to the request headers. Set CustomUrlParams to modify the URL query string.
- Windows (NTLM): Set the Windows User and Password to connect and set AuthScheme to NTLM.
- Kerberos and Kerberos Delegation: To authenticate with Kerberos, set the User and Password and set AuthScheme to NEGOTIATE. To use Kerberos Delegation, set AuthScheme to KERBEROSDELEGATION.
Connecting to Amazon S3
Set the URI to an XML/JSON document in a bucket and set the following properties to authenticate:
- AccessKey: Set to an Amazon Web Services Access Key (a user name).
- SecretKey: Set to an Amazon Web Services Secret Key.
Optionally, specify Region.
Connecting to Google Drive
Set the URI to the path to an XML/JSON file and authenticate using the OAuth standard.You can connect with a user account or a service account. In the user account flow, you do not need to set any connection properties for your user credentials, as shown in the following connection string:
Connecting to Box
Set the URI to the path to an XML/JSON file and authenticate using the OAuth standard.You can authenticate with a user account or a service account. In the user account flow, you do not need to set any connection properties for your user credentials, as shown in the following connection string:
Connecting to Dropbox
Set the URI to the path to a JSON file. To authenticate to Dropbox, use the OAuth authentication standard.You can authenticate with a user account or a service account. In the user account flow, you do not need to set any connection properties for your user credentials, as shown in the following connection string:
URI=dropbox://folder1/file.json; InitiateOAuth=GETANDREFRESH; OAuthClientId=oauthclientid1; OAuthClientSecret=oauthcliensecret1; CallbackUrl=http://localhost:12345;
Connecting to FTP
Set the URI to the address of the server followed by the path to an XML/JSON file. To authenticate, set User and Password.
URI=ftps://localhost:990/folder1/file.json; User=user1; Password=password1;
Securing REST Connections
By default, the provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats.
Configuring Automatic Schema Discovery
The available connection properties give you high-level control over the detected schemas. The following sections outline the provider's defaults and link to ways to further customize.
- FlattenArrays: Set this property to the number of the elements in a primitive array that you want to return as column values. You can also use this property with FlattenObjects to extract the properties of objects nested in arrays -- arrays are returned as aggregates by default.
FlattenObjects: By default, this is true; that is, the properties of objects and nested objects are returned as columns. When you set FlattenArrays, objects nested in the specified array elements are also flattened and returned as columns.
Flattening Nested XML
By default, the provider projects columns over the properties of objects. Arrays are returned as XML aggregates, by default.
- Object: Any parent element that does not repeat at the same height.
- Array: Any element that repeats at the same height.
In the following example, jobs is a primitive array:
In the following example, maintenance is an object array, since each maintenance node has child elements.
Fine-Tuning Data Access
You can use the following properties to gain greater control over how the provider parses the XML data into rows. You can also customize the schemas detected based on the connection string.
- RowScanDepth: This property determines the number of rows that will be scanned to detect column data types when generating table metadata.
- XPath: Explicitly specify the paths to nested object arrays, instead of detecting them during the row scan.
GenerateSchemaFiles: This property enables you to persist table metadata in static schema files that are easy to customize, to persist your changes to column data types, for example. Set this property to "OnStart" to generate schema files for all tables in your database at connection. Or, set this property to "OnUse" to generate schemas as you execute SELECT queries to tables.
Customizing the SSL Configuration
By default, the provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats to do so.
Connecting Through a Firewall or Proxy
To connect through the Windows system proxy, you do not need to set any additional connection properties. To connect to other proxies, set ProxyAutoDetect to false.
In addition, to authenticate to an HTTP proxy, set ProxyAuthScheme, ProxyUser, and ProxyPassword, in addition to ProxyServer and ProxyPort.
Set the following properties:
- To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
- To tunnel the connection, set FirewallType to TUNNEL.
- To authenticate, specify FirewallUser and FirewallPassword.
- To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.
Troubleshooting the Connection
To show provider activity from query execution to network traffic, use Logfile and Verbosity. The examples of common connection errors below show how to use these properties to get more context. Contact the support team for help tracing the source of an error or circumventing a performance issue.
- Authentication errors: Typically, recording a Logfile at Verbosity 4 is necessary to get full details on an authentication error.
- Queries time out: A server that takes too long to respond will exceed the provider's client-side timeout. Often, setting the Timeout property to a higher value will avoid a connection error. Another option is to disable the timeout by setting the property to 0. Setting Verbosity to 2 will show where the time is being spent.
- The certificate presented by the server cannot be validated: This error indicates that the provider cannot validate the server's certificate through the chain of trust. If you are using a self-signed certificate, there is only one certificate in the chain.
To resolve this error, you must verify yourself that the certificate can be trusted and specify to the provider that you trust the certificate. One way you can specify that you trust a certificate is to add the certificate to the trusted system store; another is to set SSLServerCert.