OData Class
Properties Methods Events Configuration Settings Errors
The OData class implements the Open Data Protocol (OData). It can be used to query, parse, and update/modify data contained within an OData service.
Syntax
IPWorksOData
IPWorksODataSwift
Remarks
The OData Class supports both plaintext and SSL/TLS connections. When connecting over SSL/TLS the SSLServerAuthentication event allows you to check the server identity and other security attributes. The SSLStatus event provides information about the SSL handshake. Additional SSL related settings are also supported via the Config method.
The OData component allows you to easily query OData services and create, update, and delete entries within a service. To query a service, you can set the ServiceRootURI to the service's root URI and ResourcePath to the collection within the service that you wish to query. Optionally you can set the Query*** properties to filter the results. QueryService can then be called to retrieve the results (which can be viewed via the Entry*** properties).
OData1.ServiceRootURI = "http://services.odata.org/OData/OData.svc" OData1.ResourcePath = "Products" OData1.QueryService()
To create a new entry, you can set the ServiceRootURI to the service's root URI and ResourcePath to the collection within the service that you wish to add the entry to. The Entry*** properties can be set to the values you wish to use to create the entry. CreateEntry can then be called to create the entry.
OData1.ServiceRootURI = "http://services.odata.org/OData/OData.svc" OData1.ResourcePath = "Products" OData1.EntryProperties OData1.CreateEntry()
If you wish to update an entry, you can set the ServiceRootURI to the service's root URI and ResourcePath to the specific entry you wish to update. The Entry*** properties can be set to the values you wish to update. UpdateEntry can then be called to update the entry.
OData1.ServiceRootURI = "http://services.odata.org/OData/OData.svc" OData1.ResourcePath = "Products(1)" // Index 1 is the "Name" property. OData1.EntryProperties[1].Value = "MyNewName" OData1.UpdateEntry()
Deleting an entry requires that you first set the ServiceRootURI to the service's root URI and ResourcePath to the specific entry you wish to delete. DeleteEntry can then be called to delete the entry.
OData1.ServiceRootURI = "http://services.odata.org/OData/OData.svc" OData1.ResourcePath = "Products(1)" OData1.DeleteEntry()
In addition to querying a service and manipulating its containing data, the OData component also allows you to retrieve the schema (metadata document) to determine the structure of a service. After setting ServiceRootURI to the root URI of the service, GetSchema can be called to retrieve the metadata document. The Schema*** properties will be populated upon successful retrieval of the metadata document allowing you to identify the structure of the service.
OData1.ServiceRootURI = "http://services.odata.org/OData/OData.svc" OData1.GetSchema()
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
- authorization | The Authorization string to be sent to the server. |
- authScheme | The authentication scheme to use when server authorization is required. |
- channelAuthorEmail | This property contains the email address of the author. |
- channelAuthorName | This property contains the name of the author. |
- channelAuthorUri | This property contains the URI of the author. |
- channelCategoryLabel | This property contains a textual description of the label for the category. |
- channelCategoryScheme | This property identifies a categorization scheme. |
- channelCategoryTerm | This property contains the category to which the entry or feed belongs. |
- channelContributorEmail | This property contains the email address of the contributor. |
- channelContributorName | This property contains the name of the contributor. |
- channelContributorUri | This property contains the URI of the contributor. |
- channelGenerator | This property identifies the generator of the feed. |
- channelIcon | This property contains a reference to the image that represents this feed. |
- channelId | The Id conveys a permanent, universally unique identifier for an entry or feed. |
- channelLinkHref | This property contains the location of the link. |
- channelLinkHrefLang | This property contains the language of the content at the link. |
- channelLinkLength | This property contains the length (in bytes) of the content at the link. |
- channelLinkRel | This property indicates the relation of the linked content to the feed. |
- channelLinkTitle | This property contains the title of the link. |
- channelLinkType | This property contains the MIME type of the content at the link. |
- channelLogo | This property contains logo for an image that represents the feed. |
- channelRights | This property contains information about the rights of the given feed. |
- channelRightsTextType | Text type of the rights of the feed. |
- channelSubtitle | This contains a short description of the Atom Feed. |
- channelSubtitleTextType | This property contains the text type of the sub-title of the feed. |
- channelTitle | This property contains the title of the current Atom Feed. |
- channelTitleTextType | This property contains the text type of the title of the feed. |
- channelUpdated | This property contains the date and time that the feed was updated. |
- cookieCount | The number of records in the Cookie arrays. |
- cookieDomain:(int)cookieIndex | The domain of a received cookie. |
- cookieExpiration:(int)cookieIndex | This property contains an expiration time for the cookie (if provided by the server). |
- cookieName:(int)cookieIndex | The name of the cookie. |
- cookiePath:(int)cookieIndex | This property contains a path name to limit the cookie to (if provided by the server). |
- cookieSecure:(int)cookieIndex | This property contains the security flag of the received cookie. |
- cookieValue:(int)cookieIndex | This property contains the value of the cookie. |
- entryAuthor | The Author of the current entry in an OData feed. |
- entryCount | The number of entries contained within an OData feed. |
- entryETag | The ETag of the current entry in an OData feed. |
- entryId | The ID of the current entry in an OData feed. |
- entryIndex | The index of the current entry in an OData feed. |
- entryLinksCount | The number of records in the EntryLinks arrays. |
- entryLinksResourcePath:(int)entryLinksIndex | The Resource Path of the OData entry element link. |
- entryLinksTitle:(int)entryLinksIndex | The Title of the OData entry element link. |
- entryPropertiesCount | The number of records in the EntryProperties arrays. |
- entryPropertiesAttributes:(int)entryPropertiesIndex | A space-separated list of attributes (name-value pairs) contained within an OData entry element. |
- entryPropertiesIsNull:(int)entryPropertiesIndex | Indicates whether a property value of a primitive type is null. |
- entryPropertiesName:(int)entryPropertiesIndex | The Name of the OData entry element. |
- entryPropertiesType:(int)entryPropertiesIndex | The type of the OData schema property. |
- entryPropertiesValue:(int)entryPropertiesIndex | The Value of the OData entry element. |
- entryPropertiesXPath:(int)entryPropertiesIndex | The XPath of the OData entry property. |
- entrySummary | The Summary of the current entry in an OData feed. |
- entryTitle | The Title of the current entry in an OData feed. |
- entryType | The entry category or type. |
- entryUpdated | The Date-Time when current entry in an OData feed was updated. |
- entryXML | The raw XML of the current entry in an OData feed. |
- firewallAutoDetect | This property tells the class whether or not to automatically detect and use firewall system settings, if available. |
- firewallType | This property determines the type of firewall to connect through. |
- firewallHost | This property contains the name or IP address of firewall (optional). |
- firewallPassword | This property contains a password if authentication is to be used when connecting through the firewall. |
- firewallPort | This property contains the TCP port for the firewall Host . |
- firewallUser | This property contains a user name if authentication is to be used connecting through a firewall. |
- idle | The current status of the class. |
- localHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
- ODataVersion | The OData Version. |
- otherHeaders | Other headers as determined by the user (optional). |
- otherQueryOptions | Additional Query Options to be used when querying a service. |
- parsedHeaderCount | The number of records in the ParsedHeader arrays. |
- parsedHeaderField:(int)parsedHeaderIndex | This property contains the name of the HTTP header (same case as it is delivered). |
- parsedHeaderValue:(int)parsedHeaderIndex | This property contains the header contents. |
- password | A password if authentication is to be used. |
- proxyAuthScheme | This property is used to tell the class which type of authorization to perform when connecting to the proxy. |
- proxyAutoDetect | This property tells the class whether or not to automatically detect and use proxy system settings, if available. |
- proxyPassword | This property contains a password if authentication is to be used for the proxy. |
- proxyPort | This property contains the TCP port for the proxy Server (default 80). |
- proxyServer | If a proxy Server is given, then the HTTP request is sent to the proxy instead of the server otherwise specified. |
- proxySSL | This property determines when to use SSL for the connection to the proxy. |
- proxyUser | This property contains a user name, if authentication is to be used for the proxy. |
- queryFilter | Selects only the entries that satisfy the specified filter (expression). |
- queryOrderBy | The value used to order entries when querying a service. |
- querySelect | Selects only the specified properties to be returned in an entry when querying a service. |
- querySkip | The number of entries to skip when querying a service. |
- querySkipToken | Token given by an OData server when the last query result collection is too large. |
- queryTop | Selects the first N entries when querying a service. |
- resourcePath | The Resource Path of an OData service. |
- schemaAssociationContainsTarget | Whether the navigation property contains a target. |
- schemaAssociationDescription | The documentation long description of the OData schema association. |
- schemaAssociationFromRole | The name of the starting point of the navigation. |
- schemaAssociationFromRoleDescription | The documentation long description of the OData schema FromRole association end point. |
- schemaAssociationFromRoleEntity | The name of the entity that FromRole association end point maps to. |
- schemaAssociationFromRoleMultiplicity | The multiplicity of the FromRole association end point. |
- schemaAssociationFromRoleSummary | The documentation summary of the OData schema FromRole association end point. |
- schemaAssociationName | The Name of the OData schema navigation property. |
- schemaAssociationNullable | Whether the property defined by the schema can be a null value. |
- schemaAssociationOnDelete | The delete action to be performed. |
- schemaAssociationPartner | The partner value identifying a navigation property (if any). |
- schemaAssociationRefConstraintCount | The number of referential constraints. |
- schemaAssociationRefConstraintIndex | The current index of the referential constraint. |
- schemaAssociationRefConstraintProperty | The property that takes part in the referential constraint. |
- schemaAssociationRefConstraintReferencedProperty | The corresponding property of the principal entity type. |
- schemaAssociationRelationship | The name of the relationship (association) of the navigation property. |
- schemaAssociationSummary | The documentation summary of the OData schema association. |
- schemaAssociationToRole | The name of the end point of the navigation. |
- schemaAssociationToRoleDescription | The documentation long description of the OData schema ToRole association end point. |
- schemaAssociationToRoleEntity | The name of the entity that ToRole association end point maps to. |
- schemaAssociationToRoleMultiplicity | The multiplicity of the ToRole association end point. |
- schemaAssociationToRoleSummary | The documentation summary of the OData schema ToRole association end point. |
- schemaAssociationType | The entity type. |
- schemaAssociationCount | The number of navigation properties contained within an OData schema entity. |
- schemaAssociationIndex | The index of the current navigation property in an OData schema entity. |
- schemaEntityDescription | The documentation long description of the OData schema entity. |
- schemaEntityName | The name of the OData schema entity. |
- schemaEntitySummary | The documentation summary of the OData schema entity. |
- schemaEntityCount | The number of entities contained within an OData schema. |
- schemaEntityIndex | The index of the current entity in an OData schema. |
- schemaKeysCount | The number of records in the SchemaKeys array. |
- schemaKeys:(int)schemaKeysIndex | The keys of a schema entity. |
- schemaPropertyAttributes | A space-separated list of attributes (name-value pairs) contained within an OData property element. |
- schemaPropertyDescription | The documentation long description of the OData schema property. |
- schemaPropertyIsComplexType | Indicates whether a property is derived from a complex type. |
- schemaPropertyName | The Name of the OData schema property. |
- schemaPropertyNullable | Indicates whether a property can be null. |
- schemaPropertySummary | The documentation summary of the OData schema property. |
- schemaPropertyType | The type of the OData schema property. |
- schemaPropertyCount | The number of properties contained within an OData schema entity. |
- schemaPropertyIndex | The index of the current property in an OData schema entity. |
- schemaTypeFieldAttributes | A space-separated list of attributes (name-value pairs) contained within an OData property element. |
- schemaTypeFieldDescription | The documentation long description of the OData schema property. |
- schemaTypeFieldIsComplexType | Indicates whether a property is derived from a complex type. |
- schemaTypeFieldName | The Name of the OData schema property. |
- schemaTypeFieldNullable | Indicates whether a property can be null. |
- schemaTypeFieldSummary | The documentation summary of the OData schema property. |
- schemaTypeFieldType | The type of the OData schema property. |
- schemaTypeFieldCount | The number of properties contained within an OData schema complex type. |
- schemaTypeFieldIndex | The index of the current field (property) in an OData schema complex type. |
- serviceRootURI | The root URI of an OData service. |
- SSLAcceptServerCertEncoded | The certificate (PEM/base64 encoded). |
- SSLCertEncoded | The certificate (PEM/base64 encoded). |
- SSLCertStore | The name of the certificate store for the client certificate. |
- SSLCertStorePassword | If the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store. |
- SSLCertStoreType | The type of certificate store for this certificate. |
- SSLCertSubject | The subject of the certificate used for client authentication. |
- SSLServerCertEncoded | The certificate (PEM/base64 encoded). |
- timeout | A timeout for the class. |
- transferredData | The contents of the last response from the server. |
- user | A user name if authentication is to be used. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
- config | Sets or retrieves a configuration setting. |
- createEntry | Creates a new entry within the specified OData service resource. |
- customRequest | Sends a request to the specified URL using the HTTP Method and Post Data provided. |
- deleteEntry | Deletes an entry within an OData service resource. |
- getEntryProperty | Get an OData entry property. |
- getSchema | Retrieves the schema for a service. |
- hasXPath | Determines whether a specific element exists in the document. |
- queryService | Queries an OData service using the specified parameters. |
- reset | Reset all properties of the class. |
- setEntryProperty | Set an OData entry property. |
- setSchemaEntity | Sets the schema entity. |
- setSchemaProperty | Sets the schema property. |
- setSchemaType | Sets the schema type. |
- updateEntry | Update an OData entry. |
- updateProperty | Update an OData entry property. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
- onConnected | Fired immediately after a connection completes (or fails). |
- onDisconnected | Fired when a connection is closed. |
- onEndTransfer | Fired when a document finishes transferring. |
- onEntity | Fired once for each entity retrieved. |
- onEntry | Fired once for each entry retrieved. |
- onError | Information about errors during data delivery. |
- onHeader | Fired every time a header line comes in. |
- onLog | Fires once for each log message. |
- onProperty | Fired once for each property found within an entity. |
- onSetCookie | Fired for every cookie set by the server. |
- onSSLServerAuthentication | Fired after the server presents its certificate to the client. |
- onSSLStatus | Shows the progress of the secure connection. |
- onStartTransfer | Fired when a document starts transferring (after the headers). |
- onStatus | Fired when the HTTP status line is received from the server. |
- onTransfer | Fired while a document transfers (delivers document). |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
EncodeResourcePath | Whether the ResourcePath is URL encoded. |
NameAndEmailFormat | Determines how the data of the name and e-mail properties will be formatted. |
TransferredHeaders | The full set of headers as received from the server. |
AcceptEncoding | Used to tell the server which types of content encodings the client supports. |
AllowHTTPCompression | This property enables HTTP compression for receiving data. |
AllowHTTPFallback | Whether HTTP/2 connections are permitted to fallback to HTTP/1.1. |
Append | Whether to append data to LocalFile. |
Authorization | The Authorization string to be sent to the server. |
BytesTransferred | Contains the number of bytes transferred in the response data. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
CompressHTTPRequest | Set to true to compress the body of a PUT or POST request. |
EncodeURL | If set to true the URL will be encoded by the class. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the class will perform a GET on the new location. |
HTTP2HeadersWithoutIndexing | HTTP2 headers that should not update the dynamic header table with incremental indexing. |
HTTPVersion | The version of HTTP used by the class. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
LogLevel | The level of detail that is logged. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
NegotiatedHTTPVersion | The negotiated HTTP version. |
OtherHeaders | Other headers as determined by the user (optional). |
ProxyAuthorization | The authorization string to be sent to the proxy server. |
ProxyAuthScheme | The authorization scheme to be used for the proxy. |
ProxyPassword | A password if authentication is to be used for the proxy. |
ProxyPort | Port for the proxy server (default 80). |
ProxyServer | Name or IP address of a proxy server (optional). |
ProxyUser | A user name if authentication is to be used for the proxy. |
SentHeaders | The full set of headers as sent by the client. |
StatusLine | The first line of the last response from the server. |
TransferredData | The contents of the last response from the server. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the class. |
TransferredHeaders | The full set of headers as received from the server. |
TransferredRequest | The full request as sent by the client. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
UseIDNs | Whether to encode hostnames to internationalized domain names. |
UsePlatformHTTPClient | Whether or not to use the platform HTTP client. |
UserAgent | Information about the user agent (browser). |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the class whether or not to automatically detect and use firewall system settings, if available. |
FirewallHost | Name or IP address of firewall (optional). |
FirewallPassword | Password to be used if authentication is to be used when connecting through the firewall. |
FirewallPort | The TCP port for the FirewallHost;. |
FirewallType | Determines the type of firewall to connect through. |
FirewallUser | A user name if authentication is to be used connecting through a firewall. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
Linger | When set to True, connections are terminated gracefully. |
LingerTime | Time in seconds to have the connection linger. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the class binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
ProxyExceptionsList | A semicolon separated list of hosts and IPs to bypass when using a proxy. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
TcpNoDelay | Whether or not to delay when sending packets. |
UseIPv6 | Whether to use IPv6. |
LogSSLPackets | Controls whether SSL packets are logged when using the internal security API. |
OpenSSLCADir | The path to a directory containing CA certificates. |
OpenSSLCAFile | Name of the file containing the list of CA's trusted by your application. |
OpenSSLCipherList | A string that controls the ciphers to be used by SSL. |
OpenSSLPrngSeedData | The data to seed the pseudo random number generator (PRNG). |
ReuseSSLSession | Determines if the SSL session is reused. |
SSLCACertFilePaths | The paths to CA certificate files on Unix/Linux. |
SSLCACerts | A newline separated list of CA certificate to use during SSL client authentication. |
SSLCheckCRL | Whether to check the Certificate Revocation List for the server certificate. |
SSLCipherStrength | The minimum cipher strength used for bulk encryption. |
SSLEnabledCipherSuites | The cipher suite to be used in an SSL negotiation. |
SSLEnabledProtocols | Used to enable/disable the supported security protocols. |
SSLEnableRenegotiation | Whether the renegotiation_info SSL extension is supported. |
SSLIncludeCertChain | Whether the entire certificate chain is included in the SSLServerAuthentication event. |
SSLNegotiatedCipher | Returns the negotiated ciphersuite. |
SSLNegotiatedCipherStrength | Returns the negotiated ciphersuite strength. |
SSLNegotiatedCipherSuite | Returns the negotiated ciphersuite. |
SSLNegotiatedKeyExchange | Returns the negotiated key exchange algorithm. |
SSLNegotiatedKeyExchangeStrength | Returns the negotiated key exchange algorithm strength. |
SSLNegotiatedVersion | Returns the negotiated protocol version. |
SSLProvider | The name of the security provider to use. |
SSLSecurityFlags | Flags that control certificate verification. |
SSLServerCACerts | A newline separated list of CA certificate to use during SSL server certificate validation. |
TLS12SignatureAlgorithms | Defines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True. |
TLS12SupportedGroups | The supported groups for ECC. |
TLS13KeyShareGroups | The groups for which to pregenerate key shares. |
TLS13SignatureAlgorithms | The allowed certificate signature algorithms. |
TLS13SupportedGroups | The supported groups for (EC)DHE key exchange. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |