• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting SAXParseException-org.xml.sax.SAXParseException: The root element is required in a well-form  RSS feed

 
uj joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a webservice that accepts input as userid and returns a list of groups that the user is in. Now, while processing the request (from URL) while creating SOAP message I am getting this following error:

javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: The root element is required in a well-formed document. Message being parsed:

SOAPMessage msg = msgFactory.createMessage(headers, in); //message being created

SOAPBody body = msg.getSOAPBody(); //Here, I get the exception...

http://hostname:port/UrlPattern/WebService class/WebService method/USERID //Request being made

I am stuck with this issue. Any help would be appreciated.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would certainly use SOAPui or TCPMON to see what is really in the response.

It might be a HTML formatted error message from the server and your request never got through to the web service.

Bill
 
uj joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill,

As what I think my request never passed to the web service. The exception that I am getting is while getting the body out of the message much before the request (SOAP message) was sent to web service. Is there any way I can mend my request in proper SOAP message? Basically, by request I mean request URL.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As what I think my request never passed to the web service. The exception that I am getting is while getting the body out of the message much before the request (SOAP message) was sent to web service.


Nope, that message body expects to be getting a SOAP formatted response from the web server. Therefore, do what I said before, use SOAPui or TCPMON to see what is actually being sent and received. Like I said in the 2006 thread:

This means that the start of the character stream fed to the parser was not formatted as an XML document - there are many possible causes. For example the server may be sending an error message in plain text.


Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!