?
Solved

xmlparse - Premature end of file

Posted on 2007-04-04
4
Medium Priority
?
2,854 Views
Last Modified: 2013-12-24
Hello Experts,

I'm building a page to send XML data using (<cfhttp method="post") and expecting a reply back to the same .cfm page, the sending part if working fine, it's the receiving part that is not working.  Here is my code to "wait for" and parse the reply:

<cfset x = GetHttpRequestData()>
<cfset xmldata = xmlparse(x.content)>

When I execute the .cfm page, I get the following error:

An error occured while Parsing an XML document.
Premature end of file.

Thanks,

Anthony
0
Comment
Question by:aescribens
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 13

Expert Comment

by:usachrisk1983
ID: 18857768
A quick search of Google shows that this is usually a misformatted XML document or one with special characters in it.  Can you dump x.content, make sure it's valid, and perhaps even dump into a text file that you could look at with an XML viewer (if even just your browser) to see what's up?
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 18857809
you might want to try


<cfif isxmldoc(x.content)>
<cfset xmldata = xmlparse(x.content)>
<cfelse>
Not ValidXML
</cfif>

to see if you are getting a proper xml doc back


0
 
LVL 36

Accepted Solution

by:
SidFishes earned 1500 total points
ID: 18857834
also if you are building the xml doc, make sure any place there might be special characters (& is the most common offender) use CDATA of use the replace technique as outlined here http://www.w3schools.com/xml/xml_cdata.asp on your source xml file
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 18857837
err... use CDATA OR use
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question