Link to home
Start Free TrialLog in
Avatar of aescribens
aescribens

asked on

xmlparse - Premature end of file

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
Avatar of usachrisk1983
usachrisk1983
Flag of United States of America image

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?
Avatar of SidFishes
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


ASKER CERTIFIED SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
err... use CDATA OR use