QueryService Method

Queries an OData service using the specified parameters.

Syntax

odata.queryService([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Queries an OData feed specified by ServiceRootURI and ResourcePath (ServiceRootURI/ResourcePath) using the query options specified in the Query*** properties and OtherQueryOptions. To fetch an OData feed, without performing any filtering, you can leave Query*** and OtherQueryOptions empty and call QueryService.

The query results are delivered in the TransferredData property, as well as through the Transfer event. The response headers can be retrieved via the ParsedHeaders property as well as through the Header event.

The class will then attempt to parse the query results. Upon successfully parsing the response, Channel will be set with their associated feed element values and EntryCount will be populated with the total number of entries contained within the feed. EntryIndex will also be set to 1, thus populating EntryAuthor, EntryETag, EntryTitle, EntrySummary, EntryUpdated, EntryLinks,EntryProperties and ResourcePath.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Node.js Edition - Version 20.0 [Build 8307]