• Post Reply Bookmark Topic Watch Topic
  • New Topic

xml over http  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it not sending XML over http???



It prints 'ankur bajju mohit' (ignores XML tags). Why so???

How can I send XML over HTTP??? Please point me to some links.

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried viewing the HTML source from your browser to see what's actually being sent?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Content-Type of the response is text/html. In HTML any tags that are not understood are ignored. You need to set the Content-Type to "text/xml" or "application/xml".



See also: XML on the Web has failed

You should also start the file with an XML declaration - even though it isn't strictly required.


Also note that you are not using namespaces. To be able to use XML Schema to define an XML application you need namespaces. At this point XML that doesn't use namespaces should be avoided.


On the side: The Servlet API was designed on the premise that it would be desirable to handle every request/response as fast as possible which justified the use of a separate thread for each request/response. However AJAX applications have broken that premise because they use open requests as a callback mechanism - which means the response may not be going back for a long, long time tying up the thread resources for that request/response. Ultimately AJAX and servlets do not mix that well when it comes to scalability.

See also:
Jetty Continuations
Restlet: Servlet limitations

Also remember what I pointed out here.
[ November 21, 2007: Message edited by: Peer Reynders ]
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben and Peer!

Peer, I read your post that sending XML is not always the best choice. But I am told to do it this way.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!