Skip to content

XML and SOAP contracts ​

Symptoms of XML schema and SOAP contracts. Contracts are checked by the waap-xmlcheck helper, which runs beside the inspection service.

Adding a contract is refused: "XML contract checks need waap-xmlcheck (not installed on this node)" ​

  • Symptom: the XML contracts form, waap api xml contract set or PUT .../xml/contracts/{name} answers 422 with that text; waap api xml check and the form's file check answer 503.
  • Cause: contracts are checked with waap-xmlcheck before they are stored, on the node that runs the management API, and the binary is not at helpers.xmlcheck.binary (default: next to the waap binary).
  • Check: the Helpers page under System (or waap api xml helpers): the Installed column and the binary path.
  • Fix: install waap-xmlcheck there (make build builds it), or set helpers.xmlcheck.binary to its absolute path (waap settings set helpers xmlcheck.binary=/opt/waap/waap-xmlcheck), then add the contract again.

The helper shows "not run here" or a state other than running ​

  • Cause: the page answers for the node you are connected to. A control-only node runs no helpers. An inspection node starts waap-xmlcheck only while an application has contracts and helpers.xmlcheck.enabled is true. The states restarting and not installed follow a crash or a missing binary.
  • Check: waap api xml helpers on the inspection node (restarts, crashes, the last error); the node's log (helper); waap_helper_restarts_total.
  • Fix: add a contract (the helper starts within a second), enable the helper, install the binary, or raise xmlcheck.memory when documents are refused as too complex.

A contract file "does not load" in the form or waap api xml check ​

  • Cause: a missing import (files are found by name only), an rpc/encoded WSDL, a schema libxml2 rejects, or a file in an encoding other than UTF-8 read as text.
  • Check: the message names the file and line. waap api xml check -kind wsdl -f orders.wsdl -import types.xsd repeats the check without storing anything.
  • Fix: choose the imported files together with the main file (two files may not share a name), fix the schema, or convert the file to UTF-8.

A contract is refused at upload ​

  • Symptom: "rpc/encoded (SOAP encoding) is not supported" (only literal use is); "wsdl:import is not supported" (merge the WSDL files; schemas can stay separate); "the schema does not compile: ... does not resolve to a type definition" (an imported schema is missing from the contract, or is referenced by a URL, and files are found by name only); "two files named X" (two imports with the same file name); "root ... is not a global element"; "operation ... is not in the WSDL"; "encoding ... is not supported (save the file as UTF-8)".
  • Cause: the contract uses a feature or file layout the checker does not accept. The message names which one.
  • Check: waap-xmlcheck check -kind KIND MAIN IMPORTS... reproduces the error locally.
  • Fix: add the missing files to imports, correct the names, and save the files as UTF-8.

Requests on a contract path logged with api.xml.check_unavailable or refused with 503 ​

  • Cause: the helper is not installed on that node ("not installed"), is still starting or restarting ("loading contract" right after a start), crashed during the call, or the client's circuit is open after 5 failures within a minute (it stays open for 30 seconds without calls). The verdict follows xml.on_unavailable: open logs, closed refuses with 503, and inherit applies the application's failure policy.
  • Check: the node's log ("helper exited", "starting helper"); waap_helper_restarts_total and waap_helper_calls_total{result="unavailable"}; whether the binary exists (helpers.xmlcheck.binary, default next to waap) and runs (waap-xmlcheck version).
  • Fix: install waap-xmlcheck next to waap (or set the path), with libxml2 2.14 or later available to it. If it keeps exiting, see the next entries.

api.xml.check_timeout on large documents ​

  • Cause: validation took longer than xml.budget (default 100 ms). A document that takes ten times the budget also makes the helper exit (watchdog; the log says "a validation ran over 10 times its budget") and restart.
  • Check: the event's document size; waap_helper_duration_seconds.
  • Fix: raise xml.budget (up to 2 seconds), lower max_document, or raise helpers.xmlcheck.workers if documents wait for a free worker under load.

Documents refused as needing too much memory ​

  • Symptom: api.xml.schema with "out of memory" or "Memory allocation failed".
  • Cause: the document, or the schema compile, needs more than the helper's memory bound (helpers.xmlcheck.memory, default 512 MiB; three quarters of it go to libxml2).
  • Fix: raise the memory setting if such documents are legitimate. Otherwise the refusal is the protection working against deep or huge documents.

The helper restarts every hour ​

  • Cause: helpers.xmlcheck.cpu_seconds (default 3600 CPU seconds) recycles the helper, and the contracts are loaded again at once. Under constant heavy load that can happen more often.
  • Fix: nothing to do, or raise the setting (at most 7 days).

On Linux: "helper started without its own network namespace" ​

  • Cause: the system does not allow unprivileged user namespaces (kernel.unprivileged_userns_clone=0, or some container runtimes). The helper runs in the node's network namespace. It has no network code and refuses every URL, so this lowers defense in depth only.
  • Fix: allow user namespaces for the service user, if your policy permits.

Valid documents refused with api.xml.schema "value does not match pattern facet" ​

  • Cause: the pattern is enforced with Go regular expressions. They implement XSD patterns exactly for what translates, so either the value really breaks the pattern, or the schema relies on whitespace handling of a type (patterns apply after the type's whiteSpace normalization).
  • Check: the event names the pattern and the type; test the value against it.
  • Fix: correct the schema or the client. While you do, add an exception for the element path (ignore_rules: [api.xml.schema] on that path).

The upload warns "pattern ... is not enforced" ​

  • Cause: the pattern uses XSD syntax that RE2 cannot express: character class subtraction, \I or \C, a negated block inside a class, an unknown Unicode block, or a repetition count over 1000. The rest of the schema is enforced; that pattern is not.
  • Fix: rewrite the pattern without the construct (list the remaining characters instead of subtracting).

A valid SOAP call is refused with api.soap.operation ​

  • Symptom: "operation {urn:...}Name is not in the contract" for a call the service accepts.
  • Cause: the uploaded WSDL is older than the service; or the client sends the Body element in another namespace than the WSDL declares (a common client bug); or the operation is document/literal without a body part, which cannot be told apart (the upload warns).
  • Check: waap-xmlcheck check -kind wsdl service.wsdl types.xsd lists the operations and their Body elements. Compare with the event's matched value ({namespace}local).
  • Fix: upload the service's current WSDL, fix the client's namespace, or set on_violation: log on the contract while it is sorted out.

api.soap.action_mismatch for a client that sends a fixed SOAPAction ​

  • Cause: some clients send one SOAPAction for every operation, or a URL form that the WSDL does not use.
  • Check: the event's matched value (the header) against the operation's action in the check output.
  • Fix: set soap_action: ignore on the contract. The Body element still decides the operation.