iGlow / Blog / Content is not allowed in prolog
SAP CPI error
Content is not allowed in prolog in SAP CPI
Short answer: This error means an XML step in SAP CPI received a payload that does not start as XML. It usually happens when a call returned an HTML error page or JSON, or the body has stray characters before the first tag. To fix it, trace the payload and correct the step that produced it.
The problem
A mapping or XSLT step fails with "Content is not allowed in prolog" and you cannot see what it was fed. The payload in the log may look fine, because the trouble is a hidden byte or an HTML error page from an earlier call. You raise the log level to Trace, send again, open the trace and read through the steps to find where XML turned into something else.
What does Content is not allowed in prolog mean?
The prolog is everything before the first XML element, such as the optional XML declaration. The parser found text there that XML does not allow. SAP lists the message for a Cloud Integration flow with a message mapping step in KBA 3258051. The text 'occured' is spelled that way in the SAP message.
Full text in the log: com.sap.it.rt.adapter.http.api.exception.HttpResponseException: An internal server error occured: Content is not allowed in prolog
Why does it happen?
The most common cause comes first.
- A receiver call failed and returned an HTML page (login, proxy or error page) that the next step tried to read as XML.
- The payload is JSON or plain text, but the step expects XML.
- The body begins with whitespace, a hidden byte order mark or other characters before
<?xml. - The body is empty.
How do I fix Content is not allowed in prolog in SAP CPI?
- Set the iFlow log level to Trace and send the message again.
- Open the message trace and look at the payload going into the failing step.
- If it is HTML or JSON, fix the earlier step that produced it, or convert it to XML first.
- If it is XML with extra characters, remove them before the step. Resend.
How do I confirm it is fixed?
The payload at the failing step starts with <?xml or a root element, and the message completes.
Which adapter or step causes it?
Any step that parses XML: Message Mapping, XSLT, XML Validator, or an adapter with XML conversion. The payload may come from any earlier step.
Tips to avoid it next time
Check the status code of a receiver call before you use its answer. A router with a condition on the HTTP status can send failures to an error path instead of a mapping. Set the Accept header so the server returns XML. Remember that Trace log level shows payloads, so switch it off when you are done. This guide explains tracing.
Related errors
- Cannot produce target element (a mapping error on valid XML)
- statusCode: 401 (the refusal often returns an HTML page)
- PKIX path building failed (the call fails before any answer)
See all ten in the 10 most common SAP CPI errors and how to fix each for SAP Cloud Integration (SAP Integration Suite).
The easy way: fix Content is not allowed in prolog with iGlow
iGlow is an AI agent for SAP Integration Suite and CPI that runs as a Chrome extension side panel. The hunt above is what the Fix button does for you.
- Open the panel. The failed message is listed with a Fix button.
- Click Fix. iGlow reads the error, the failing step and a short trace excerpt, and explains what entered the step and where it came from.
- If a script or XSLT is at fault, iGlow proposes a small change as a diff. You review and approve it, and iGlow takes a snapshot before it saves.
- If an earlier call returned an HTML page or JSON, iGlow explains which call and gives next steps. Fixing that call, for example its credentials, is up to you.

Nothing is saved or deployed without your click, and tenants tagged PRD are never changed. See the Fix failed messages guide. Add iGlow to Chrome.
Questions
What does Content is not allowed in prolog mean?
The XML parser found text before the XML starts. The payload is not XML, or has extra characters at the beginning.
How do I fix Content is not allowed in prolog in SAP CPI?
Trace the message, find the payload that enters the failing step, and fix the step that produced HTML, JSON or stray characters.
Which adapter or step causes Content is not allowed in prolog?
A step that parses XML, such as Message Mapping or XSLT. The bad payload usually comes from an earlier receiver call.