empty responseXML from XMLHttpRequest with no parse error

L

Lan Vuong

I am using the XMLHttpRequest object to get an XML response from a
servlet. I check the readyState (4) on my asynchronous call and also
check the parseError.errorCode (0). Everything seems to work except
that when I retrieve the responseXML it is an empty document.

Does anyone have other ideas on what's going wrong?

Thanks!
 
M

Martin Honnen

Lan said:
I am using the XMLHttpRequest object to get an XML response from a
servlet. I check the readyState (4) on my asynchronous call and also
check the parseError.errorCode (0). Everything seems to work except
that when I retrieve the responseXML it is an empty document.

Does anyone have other ideas on what's going wrong?

Does that servlet have a public URL? Is so post it then we can try to
figure out what could be wrong. Maybe the servlet doesn't send the XML
as text/xml or application/xml?
 
L

Lan Vuong

Martin Honnen said:
Does that servlet have a public URL? Is so post it then we can try to
figure out what could be wrong. Maybe the servlet doesn't send the XML
as text/xml or application/xml?

Hi Martin,

I checked the servlet and explicitly set the Content-Type to text/xml
and it seems to get the responseXML properly. Thanks for the tip.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,002
Messages
2,570,261
Members
46,858
Latest member
FlorrieTuf

Latest Threads

Top