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

Problem of 'XmlPullParserException'  RSS feed

 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellow Ranchers,


I encountered the error XmlPullParserException: unexpected type (position:END_DOCUMENT null@1:0 in java.io.InputStreamReader@602b9370) ,while coding a webservice client using kSOAP2.

I only need to know what this error signifies and in what aspect I am going wrong. I've searched over the net, but found nothing useful.


Please help me out...
Thanks in advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while coding a webservice client


Surely you meant while executing.

If this was my problem I would immediately suspect the format of the response stream. I would use TCPMON or SoapUI to capture a copy of the stream - many problems become obvious when you can look at the real message text.

Bill
 
VineetK Singh
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill!!
 
Krishan Selvaraj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
VineetK Singh wrote:Thanks Bill!!


Hi Vinteek,

Did you find the exact problem? I too face the same problem. Please help me.

Thank you.


Regards,
Science.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any number of problems can create a character stream that will cause a parser exception.

The first thing to do is to capture the text being generated so you can examine it carefully.

A programmer's editor which can display hex values is best for this because a plain text editor may ignore special characters or display them as ordinary characters. Microsoft Word documents are notorious for inserting "smart punctuation" characters which are not valid XML.

Bill
 
Krishan Selvaraj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Any number of problems can create a character stream that will cause a parser exception.

The first thing to do is to capture the text being generated so you can examine it carefully.

A programmer's editor which can display hex values is best for this because a plain text editor may ignore special characters or display them as ordinary characters. Microsoft Word documents are notorious for inserting "smart punctuation" characters which are not valid XML.

Bill


Hi I used "responseDump()" to capture the returned data. But no result came.

Regards,
Science
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The TCPMON tool or the SoapUI kit can capture both request and response text for examination.

It is also possible that the response stream is empty due to some error you have not detected yet.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!