cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2069
Views
0
Helpful
2
Replies

XML API validation: Parsing Error: Content is not allowed in prolog

jeanlaforest1
Level 1
Level 1

I am sending the following xml message to https://mywebsite.webex.com/WBXService/XMLService

<?xml version="1.0" encoding="UTF-8"?>

<serv:message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<header>

<securityContext>

<webExID>myuserid</webExID>

<password>mypassword</password>

<siteID>mysite</siteID>

<partnerID>mypartnerid</partnerID>

<email>myemail</email>

</securityContext>

</header>

<body>

<bodyContent xsi:type="java:com.webex.service.binding.meeting.LstsummaryMeeting">

<listControl>

<startFrom>1</startFrom>

<maximumNum>10</maximumNum>

<listMethod>OR</listMethod>

</listControl>

<order>

<orderBy>CONFNAME</orderBy>

<orderAD>ASC</orderAD>

<orderBy>STARTTIME</orderBy>

<orderAD>ASC</orderAD>

</order>

</bodyContent>

</body>

</serv:message>

I get the following response.

<serv:message xmlns:serv=http://www.webex.com/schemas/2002/06/service xmlns:com=http://www.webex.com/schemas/2002/06/common><serv:header><serv:response><serv:result>FAILURE</serv:result>

<serv:reason>validation: Parsing Error : Content is not allowed in prolog.

Line : 1

Column : 1

</serv:reason>

<serv:gsbStatus>PRIMARY</serv:gsbStatus>

<serv:exceptionID>999999</serv:exceptionID>

</serv:response>

</serv:header>

<serv:body><serv:bodyContent></serv:body>

</serv:message>

This must be a rookie mistake. Can you help?

Thanks

2 Replies 2

dstaudt
Cisco Employee
Cisco Employee

That error is almost always due to whitespace or otherwise 'invisible' characters at the very top of the XML document, i.e. prior to the 'prologue' <?xml version="1.0" encoding="UTF-8"?>

If there is not an obvious space or blank line before the prologue, then the other common problem can be due to an invisible 'byte order mark' (BOM) Byte order mark - Wikipedia, the free encyclopedia

at the beginning of the XML portion.  This can occur if you've saved the XML in a windows app like Notepad.

java - How to make notepad to save text in utf-8 without bom? - Stack Overflow

Thanks much. I had read that before but did not believe it applied to me

since I was not using Notepad to generate the string.

I was building the xml string in the code. Anyway I finally replace that

method with the proper XmlTextWriter class and that solved my issue.

Thanks again for your help.

Jean Laforest

Pronex, Inc.

jeanlaforest@pronexinc.com

(972) 375-1941

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: