Skip to content
Docs

OData services

An OData service is imported from its $metadata document. Publicus reads the document, works out every operation the service exposes, and stores them so an OData Operation node can call one by name.

OData describes a type system rather than a list of URLs, so the addresses are derived from the service’s own conventions at call time. That is what lets the query options — $filter, $select, $expand, $orderby, $top, $skip, $count — stay separate typed fields on the node instead of a query string you assemble by hand.

From OData services, the OData tab of APIs under Services, create one and fill in:

  • Name — how you will recognise it later.
  • Service root — the base URL the service is addressed at.
  • OData version — this decides both the URL conventions and the metadata format. It matters: a version 2 document read as version 4 parses to nothing rather than to something subtly wrong.
  • Where is the CSDL? — one of three answers below.
The Create OData service form: Name, Service root, OData version, and Where is the CSDL? with Paste the document, Fetch it from a public URL and Fetch it as a connection
The Create OData service form: Name, Service root, OData version, and Where is the CSDL? with Paste the document, Fetch it from a public URL and Fetch it as a connection
Source Use it when
Paste the document You have the $metadata document in hand. It is stored exactly as given.
Fetch it from a public URL The metadata endpoint is publicly reachable. The URL ends in $metadata.
Fetch it as a connection The metadata endpoint needs a credential. Pick a Connection and the document is fetched with it.

Fetching happens while you are still on the form, so a wrong URL, a refused credential or an unfilled placeholder comes back as an error on the field rather than as a saved service that turns out to be empty.

The Create OData service form with Fetch it from a public URL selected and an error under Metadata URL: the metadata document answered 401, is not public, and no credential was sent
The Create OData service form with Fetch it from a public URL selected and an error under Metadata URL: the metadata document answered 401, is not public, and no credential was sent

With a connection selected, the URL may contain placeholders such as {division} or {region}, filled from that connection’s configuration.

Importing parses the document into one row per operation. Open the service and switch to its operations to see them, and to search by name.

A service's OData operations list, grouped by entity set, with each operation's kind: Create, Get by key and List
A service's OData operations list, grouped by entity set, with each operation's kind: Create, Get by key and List

Two things about the parse are worth knowing:

  • A service that publishes no capability annotations keeps every query option. Absence is read as “unknown”, never as “unsupported” — OData version 2 has no vocabulary for capabilities at all, so a service that says nothing would otherwise become one you cannot filter.

  • A service that parsed to nothing is findable. The list has a filter for exactly that, because an empty service usually means the wrong version was chosen or the document was not what it claimed to be.

    The OData services list: each service's Ingest state, operation count and version, one Ready with 3 operations and one Not ingested with 0
    The OData services list: each service's Ingest state, operation count and version, one Ready with 3 operations and one Not ingested with 0

Saving re-parses when the document itself changed, or when nothing has been parsed out of the service yet. Renaming a service does not re-parse it.

Re-ingest on the edit page re-parses unconditionally. Use it after the service publishes a new version of its metadata.

  • OData Operation calls one operation as a flow step, with the query options as fields.
  • OData Operation Pack exposes several operations to an agent as tools. Because a stored operation records whether it reads or writes, a listing tool in a pack does not inherit the approval a delete needs.

Both authenticate with a Connection or a Secret chosen on the node, which is separate from whatever credential read the metadata.