Pure functions for the SOAP 1.1 client: operation settings, the request envelope, reading the response or fault, which failures to retry and error values. No I/O.
The shell parses XML into elements of this shape, and serialises nothing: the envelope is built here as a string.
{:name "GetListsResult" :ns "http://tempuri.org/" :nil? false :text "" :children [element ...]}
Pure functions for the SOAP 1.1 client: operation settings, the request
envelope, reading the response or fault, which failures to retry and error
values. No I/O.
The shell parses XML into elements of this shape, and serialises nothing:
the envelope is built here as a string.
{:name "GetListsResult" :ns "http://tempuri.org/"
:nil? false :text "" :children [element ...]}(element-key el-name)The kebab-case keyword for an element name: ListEntries -> :list-entries.
The kebab-case keyword for an element name: ListEntries -> :list-entries.
(element-value el arrays)An element as data. xsi:nil is nil; KeyValueOf… items are a map with the keys as strings; a WCF array is a vector; any other element with children a map with kebab-case keys; a leaf its text, a string.
An array is recognised by an ArrayOf… name, items in the Serialization/Arrays namespace, or two or more children of one name. Name one that may hold a single item, or none, in arrays (#{:list-entries}), or it reads as a map.
An element as data. xsi:nil is nil; KeyValueOf… items are a map with the
keys as strings; a WCF array is a vector; any other element with children a
map with kebab-case keys; a leaf its text, a string.
An array is recognised by an ArrayOf… name, items in the Serialization/Arrays
namespace, or two or more children of one name. Name one that may hold a
single item, or none, in arrays (#{:list-entries}), or it reads as a map.(envelope {:keys [element namespace data-namespace]} request)The SOAP 1.1 envelope for a call. Parameters are in the operation's namespace; members of nested values in :data-namespace (WCF's http://schemas.datacontract.org/2004/07/<CLR namespace>); a vector of scalars is a WCF array (string, int, long, boolean items).
Element names are written as given: the contract is case-sensitive and its parameters are often camelCase (filterRequest) where members are PascalCase. A map is written in DataContract's default member order, ordinal by name; pass [name value] pairs where the contract declares another order.
The SOAP 1.1 envelope for a call. Parameters are in the operation's namespace; members of nested values in :data-namespace (WCF's http://schemas.datacontract.org/2004/07/<CLR namespace>); a vector of scalars is a WCF array (string, int, long, boolean items). Element names are written as given: the contract is case-sensitive and its parameters are often camelCase (filterRequest) where members are PascalCase. A map is written in DataContract's default member order, ordinal by name; pass [name value] pairs where the contract declares another order.
(operation-spec config op opts)Settings for one call: the client's defaults, then (:operations config) for op, then the per-call opts. The SOAPAction is WCF's default, namespace + contract + "/" + operation, unless :action is given.
Settings for one call: the client's defaults, then (:operations config) for op, then the per-call opts. The SOAPAction is WCF's default, namespace + contract + "/" + operation, unless :action is given.
(outcome status {:keys [fault malformed] :as read})An attempt's outcome from the HTTP status and the read envelope: a fault whatever the status, then a non-2xx status, then an unreadable body.
An attempt's outcome from the HTTP status and the read envelope: a fault whatever the status, then a non-2xx status, then an unreadable body.
(pairs? v)Whether v is an ordered request: a sequence of [name value] pairs.
Whether v is an ordered request: a sequence of [name value] pairs.
(read-envelope root {:keys [operation arrays]})Read a parsed response envelope: {:body .. :result ..}, {:fault ..}, or {:malformed cause}. :body is the response element as data, :result its <Operation>Result.
Read a parsed response envelope: {:body .. :result ..}, {:fault ..}, or
{:malformed cause}. :body is the response element as data, :result its
<Operation>Result.(retry-fault? retry-faults message)Whether a fault's message matches one of retry-faults: a string it contains, or a regex. iBABS answers a throttled call with the bare fault "Unknown fault occured".
Whether a fault's message matches one of retry-faults: a string it contains, or a regex. iBABS answers a throttled call with the bare fault "Unknown fault occured".
(retryable? {:keys [kind status] :as failure} {:keys [idempotent?] :as spec})Whether a failed attempt is worth repeating. A call that never connected, a 429 and a fault named in :retry-faults were not carried out. A timeout, an I/O error or a 5xx may have been, so they are retried only for an :idempotent? operation, the default.
Whether a failed attempt is worth repeating. A call that never connected, a 429 and a fault named in :retry-faults were not carried out. A timeout, an I/O error or a 5xx may have been, so they are retried only for an :idempotent? operation, the default.
(soap-error {:keys [kind fault status cause]}
{:keys [operation]}
endpoint
attempts)The :error map of a failed call. A fault is :fault with the server's :code and :message; anything else :external-error naming the endpoint.
The :error map of a failed call. A fault is :fault with the server's :code and :message; anything else :external-error naming the endpoint.
(unavailable? {:keys [kind status fault]} {:keys [retry-faults]})Whether a failure says the service could not answer: no connection, a timeout, an I/O error, a 429 or 5xx without a fault, or a fault named in :retry-faults. This is what counts against the circuit.
Whether a failure says the service could not answer: no connection, a timeout, an I/O error, a 429 or 5xx without a fault, or a fault named in :retry-faults. This is what counts against the circuit.
(valid-request? request)Whether request can be sent: nil, a map, or [name value] pairs.
Whether request can be sent: nil, a map, or [name value] pairs.
(with-credentials request {:keys [credential-elements username password]})Request with the credentials prepended as the parameters named by :credential-elements, e.g. ["username" "password"].
Request with the credentials prepended as the parameters named by :credential-elements, e.g. ["username" "password"].
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |