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
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
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?
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
<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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
err... use CDATA OR use