OData Class
Properties Methods Events Configuration Settings Errors
The OData component implements the Open Data Protocol (OData). It can be used to query, parse, and update/modify data contained within an OData service.
Class Name
IPWorks_OData
Procedural Interface
ipworks_odata_open(); ipworks_odata_close($res); ipworks_odata_register_callback($res, $id, $function); ipworks_odata_get_last_error($res); ipworks_odata_get_last_error_code($res); ipworks_odata_set($res, $id, $index, $value); ipworks_odata_get($res, $id, $index); ipworks_odata_do_config($res, $configurationstring); ipworks_odata_do_createentry($res); ipworks_odata_do_customrequest($res, $httpmethod, $url, $postdata); ipworks_odata_do_deleteentry($res); ipworks_odata_do_getentryproperty($res, $xpath); ipworks_odata_do_getschema($res); ipworks_odata_do_hasxpath($res, $xpath); ipworks_odata_do_queryservice($res); ipworks_odata_do_reset($res); ipworks_odata_do_setentryproperty($res, $xpath, $value); ipworks_odata_do_setschemaentity($res, $name); ipworks_odata_do_setschemaproperty($res, $name); ipworks_odata_do_setschematype($res, $name); ipworks_odata_do_updateentry($res); ipworks_odata_do_updateproperty($res, $xpath, $value);
Remarks
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 | The domain of a received cookie. |
CookieExpiration | This property contains an expiration time for the cookie (if provided by the server). |
CookieName | The name of the cookie. |
CookiePath | This property contains a path name to limit the cookie to (if provided by the server). |
CookieSecure | This property contains the security flag of the received cookie. |
CookieValue | 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 | The Resource Path of the OData entry element link. |
EntryLinksTitle | The Title of the OData entry element link. |
EntryPropertiesCount | The number of records in the EntryProperties arrays. |
EntryPropertiesAttributes | A space-separated list of attributes (name-value pairs) contained within an OData entry element. |
EntryPropertiesIsNull | Indicates whether a property value of a primitive type is null. |
EntryPropertiesName | The Name of the OData entry element. |
EntryPropertiesType | The type of the OData schema property. |
EntryPropertiesValue | The Value of the OData entry element. |
EntryPropertiesXPath | 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. |
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 component 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 component. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
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 | This property contains the name of the HTTP header (same case as it is delivered). |
ParsedHeaderValue | This property contains the header contents. |
Password | A password if authentication is to be used. |
ProxyAuthScheme | This property is used to tell the component which type of authorization to perform when connecting to the proxy. |
ProxyAutoDetect | This property tells the component 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. |
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. |
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. |
SchemaAssociationOnDelete | The delete action to be performed. |
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. |
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 | 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. |
Timeout | A timeout for the component. |
TransferredData | The contents of the last response from the server. |
User | A user name if authentication is to be used. |
AttrCount | The number of records in the Attr arrays. |
AttrName | The Name provides the local name (without prefix) of the attribute. |
AttrNamespace | Attribute namespace. |
AttrPrefix | Attribute prefix (if any). |
AttrValue | Attribute value. |
XChildrenCount | The number of records in the XChild arrays. |
XChildName | The Name property provides the local name (without prefix) of the element. |
XChildNamespace | Namespace of the element. |
XChildPrefix | Prefix of the element (if any). |
XChildXText | The inner text of the element. |
XElement | The name of the current element. |
XNamespace | The namespace of the current element. |
XParent | The parent of the current element. |
XPath | Provides a way to point to a specific element in the document. |
XPrefix | The prefix of the current element. |
XSubTree | A snapshot of the current element in the document. |
XText | The text of the current element. |
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 component. |
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.
Connected | Fired immediately after a connection completes (or fails). |
Disconnected | Fired when a connection is closed. |
EndTransfer | Fired when a document finishes transferring. |
Entity | Fired once for each entity retrieved. |
Entry | Fired once for each entry retrieved. |
Error | Information about errors during data delivery. |
Header | Fired every time a header line comes in. |
Property | Fired once for each property found within an entity. |
SetCookie | Fired for every cookie set by the server. |
StartTransfer | Fired when a document starts transferring (after the headers). |
Status | Fired when the HTTP status line is received from the server. |
Transfer | 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. |
AllowIdenticalRedirectURL | Allow redirects to the same URL. |
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. |
EncodeURL | If set to true the URL will be encoded by the component. |
FollowRedirects | Determines what happens when the server issues a redirect. |
GetOn302Redirect | If set to true the component will perform a GET on the new location. |
HTTPVersion | The version of HTTP used by the component. |
IfModifiedSince | A date determining the maximum age of the desired document. |
KeepAlive | Determines whether the HTTP connection is closed after completion of the request. |
MaxRedirectAttempts | Limits the number of redirects that are followed in a request. |
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. |
TransferredDataLimit | The maximum number of incoming bytes to be stored by the component. |
TransferredHeaders | The full set of headers as received from the server. |
UseChunkedEncoding | Enables or Disables HTTP chunked encoding for transfers. |
ChunkSize | Specifies the chunk size in bytes when using chunked encoding. |
UserAgent | Information about the user agent (browser). |
KerberosSPN | The Service Principal Name for the Kerberos Domain Controller. |
ConnectionTimeout | Sets a separate timeout value for establishing a connection. |
FirewallAutoDetect | Tells the component 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. |
KeepAliveTime | The inactivity time in milliseconds before a TCP keep-alive packet is sent. |
KeepAliveInterval | The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received. |
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 TCP port in the local host where the component binds. |
MaxLineLength | The maximum amount of data to accumulate when no EOL is found. |
MaxTransferRate | The transfer rate limit in bytes per second. |
RecordLength | The length of received data records. |
TCPKeepAlive | Determines whether or not the keep alive socket option is enabled. |
UseIPv6 | Whether to use IPv6. |
TcpNoDelay | Whether or not to delay when sending packets. |
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. |
CodePage | The system code page used for Unicode to Multibyte translations. |