XML
Cheat sheet · https://pcornel.dk/topic.php?topic=5307
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
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Caller / request | Environment/version, identity and exact request contract are attributable | Hidden defaults, wrong endpoint/version, leaked or mismatched credentials |
| Server / response | Status, headers, structured body and request ID are interpreted together | Status-only handling, ignored error body, ambiguous async result or unsafe retry |
| State / proof | Write result is reconciled with resource read-back or acceptance test | Response success treated as final target success without verification |
| Troubleshooting | First failed boundary is preserved, changed minimally and retested | Blind 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