Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

parsing SOAP messages using DOM parser in JAXP  RSS feed

 
Chandhrasekar Saravanan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,
I am trying to parse SOAP messages, using
DOM Parser in java. (javax.xml.dom.). as the first message is HTTP, the DOM parser cannot understand the document and its giving out an exception mentioning root element not found.
what should i have to do, so that dom ignores
the HTTP message and starts parsing from soap
envelope
Thanks in advance
Chandhra
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is things like that that the packages such as Apache SOAP or AXIS are good for. In a servlet setting, the servlet engine does that automatically.
But if you want to do it yourself, you will have to grab those headers off separately somehow. There can be any number of headers - the end of headers is signalled by a blank line.
One option is to read the entire message after the headers into a String, then use that to create an InputStream to feed to the parser.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!