Skip to content Skip to sidebar Skip to footer

Ksoap2 Xmlpullparserexception Unterminated Entity Ref

I have a user email me yesterday that he is having a problem with my application so i started debugging with him and had him sent me the log of the phone and he is getting a XmlPul

Solution 1:

Unterminated entity this error occurs when

1... Error in response string may be some entity are not closed.

<root><a> first </a><b>second             <----- </b> missing here
</roor>

2... You are getting some xml character in xml file

 like      & { } � ...

you need to replace all & with & amp;see this answer

...
Stringstr = writer.toString();
str = str.replaceAll("&","&amp;");
str = str.replaceAll("?","&#63;");
returnstr;

Solution 2:

I was having the same problem on an Android 2.2 device and found that ksoap2 2.6.5 isn't compatible with Android 2.2. Well I think that's the problem, all I know is it throws these errors. I downgraded my ksoap2 to 2.4 and it started working again.

Solution 3:

I had the same problem. the solution was when I send the response from the XML I have to replace the "&" with & in the username, for that some users had the problem but others no.

So step 2 in "MAC" answer

Post a Comment for "Ksoap2 Xmlpullparserexception Unterminated Entity Ref"