Pcornel
Automation · APIs

XML

Cheat sheet · https://pcornel.dk/topic.php?topic=5307

Back to the Topic

Answer

XML representation semantics for APIs, including namespaces, encoding, schema validation and secure parser behavior.

Remember

  • Well-formed XML ≠ schema-valid XML; element structure and types still require contract validation.
  • Element name ≠ fully qualified identity; namespaces can distinguish otherwise identical local names.
  • XML declaration ≠ actual transport encoding guaranteed; HTTP and byte content must agree.
  • Parser accepts document ≠ parser configuration safe; external entity and expansion behavior can introduce security risk.

First checks

  • curl -sS -H 'Accept: application/xml' <url> | xmllint --format - — XML response
  • Namespaces in responses — parsing
  • Safe parser (XXE) — security

Verify in this order

response → XML parser → tree

Where it usually breaks

Well-formed XML proves only syntax; namespace, schema, parser security and business meaning remain separate boundaries.

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

XML API boundary map

BoundaryHealthy evidenceSuspicious evidence
Caller / requestEnvironment/version, identity and exact request contract are attributableHidden defaults, wrong endpoint/version, leaked or mismatched credentials
Server / responseStatus, headers, structured body and request ID are interpreted togetherStatus-only handling, ignored error body, ambiguous async result or unsafe retry
State / proofWrite result is reconciled with resource read-back or acceptance testResponse success treated as final target success without verification
TroubleshootingFirst failed boundary is preserved, changed minimally and retestedBlind retries, credential rotation, replay or payload edits before evidence is captured

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5307

Confirmation

Confirm action

Continue?