| Previous | Next |
| MQ_ERROR_Q_ADS_PROPERTY_NOT_SUPPORTED | MQ_ERROR_UNSUPPORTED_CLASS |
MQ_ERROR_BAD_XML_FORMAT
What this result actually narrows down
The important part of MQ_ERROR_BAD_XML_FORMAT is not only whether the call failed, but which MSMQ subsystem had enough information to return this specific result. Its diagnostic boundary is application-supplied SRMP XML is not well formed. Validate the fragment as XML with namespaces and encoding before assigning the SOAP header property.
Capture the parser line/column and a redacted hash of the original Unicode text. When diagnosing this result, logging only the post-escaped transport representation can hide the defect introduced before MSMQ received it.
When diagnosing this result, SRMP carries message metadata in SOAP/XML form., application-generated SOAP header content must be well-formed XML before MSMQ can merge or serialize it into an envelope.
MSMQ objects involved
| Subsystem | SRMP message construction and the XML/SOAP envelope properties |
|---|---|
| Decisive boundary | well-formed XML is required before MSMQ can incorporate application-supplied header material into an SRMP message |
| Code-specific focus | application-supplied SRMP XML is not well formed |
| Primary recovery rule | Do not escape the entire document twice; correct the exact parser error. |
When diagnosing this result, the failure occurs before XML can be used as valid SRMP metadata., network tracing or queue recreation cannot make malformed markup well formed. The code-specific boundary is application-supplied SRMP XML is not well formed.
Triage data
- The exact unicode xml supplied before serialization; associate it explicitly with it.
- When diagnosing it, encoding declaration, namespaces, element nesting, and prohibited characters; capture the value before cleanup or retry changes it.
- In the path, whether the content was placed in the soap header, body, or complete envelope property; compare it with a known-good call using the same account and queue type.
Log certificate thumbprints, provider names, SIDs, GUIDs, lengths, and hashes where useful, but do not log private keys, symmetric keys, credentials, or confidential message bodies.
A safe investigation order
- Record the unsigned HRESULT, it, and the native API or COM method before a framework replaces it with a generic exception.
- When diagnosing it, capture encoding declaration, namespaces, element nesting, and prohibited characters.
- In the path, capture whether the content was placed in the SOAP header, body, or complete envelope property.
- verify the postcondition after the failed call: queue existence, message presence, directory object state, transaction outcome, or generated output may differ by result.
- When diagnosing it, apply the code-specific recovery rule: Do not escape the entire document twice; correct the exact parser error.
Correct response
Do not escape the entire document twice; correct the exact parser error.
When diagnosing it, retry only after a measurable state change: corrected property data, resized storage, restored service/directory reachability, recreated handle, completed transaction recovery, or repaired certificate access., bound attempts and keep an idempotency key for sends or directory mutations.
What this code is not
In the path, queue recreation, permission changes, and network retries cannot correct malformed XML supplied before SRMP serialization. The specific focus for it remains application-supplied SRMP XML is not well formed.
- In the path, granting broad queue or certificate permissions may mask the symptom while creating a security defect. test the exact identity and access needed by the operation.
- changing queue names, deleting directory objects, or recreating certificates without reconciliation can create a second object while callers still reference the first.
Example failure path
An http transport integration encounters it. It validates the original Unicode XML and fixes the first parser error before assigning the MSMQ property again.
Automated coverage should preserve the original arrays/identities, confirm that cleanup is safe after it, and test that a retry does not duplicate messages or directory objects.
Technical references
- Microsoft: PROPID_M_SOAP_ENVELOPE — source used for the result analysis.
- W3C: XML 1.0 — source used for the result analysis.
- W3C: SOAP 1.2 messaging framework — source used for the result analysis.
- Microsoft: Message Queuing error and information codes — source used for the result analysis.
Looking for a different code? Search another status or error code.