Getting error when calling Post on HTTP listener. "Content is not allowed in prolog"

0 votes
asked Feb 7, 2023 by gowd-h-4196 (120 points)

I am looking to create channel that can accept 

1. POST request and return 200

2. GET request and return a cutom response.

Below channel works fine with GET but throws an error "Content is not allowed in prolog" when calling with POST.


1 Answer

0 votes
"Content is not allowed in prolog" usually indicates that there is non-XML data being sent in the payload of your POST message.  Your QIE channel is configured to accept XML message format, so the content of the POST request must be XML when QIE is set to automatically extract the content of the POST to use as the message data.

However, from looking at your code, I think you want to uncheck the "Extract content as message" checkbox.  Doing so will cause QIE to pass the entire message (including metadata) into the channel, which will already be formatted as XML.  From there, you can extract the content to work with it, even if it's not XML data.
answered Feb 7, 2023 by jon-t-7005 (7,590 points)