2

I am trying to access a web service through android phone. Web service is published on localhost. But now I am getting a following error. Does any one have experience with it?

    06-15 14:27:03.969: WARN/System.err(277): org.xmlpull.v1.XmlPullParserException: attr value delimiter missing! (position:START_TAG <html dir='null'>@2:11 in java.io.InputStreamReader@44f4e7d0) 
    06-15 14:27:04.000: WARN/System.err(277):     at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
    06-15 14:27:04.000: WARN/System.err(277):     at org.kxml2.io.KXmlParser.error(KXmlParser.java:269)
    06-15 14:27:04.000: WARN/System.err(277):     at org.kxml2.io.KXmlParser.parseStartTag(KXmlParser.java:708)
    06-15 14:27:04.000: WARN/System.err(277):     at org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:342)
    06-15 14:27:04.000: WARN/System.err(277):     at org.kxml2.io.KXmlParser.next(KXmlParser.java:1385)
    06-15 14:27:04.011: WARN/System.err(277):     at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1415)
    06-15 14:27:04.011: WARN/System.err(277):     at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)
    06-15 14:27:04.011: WARN/System.err(277):     at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
    06-15 14:27:04.099: DEBUG/dalvikvm(277): GC_FOR_MALLOC freed 5747 objects / 296016 bytes in 90ms
    06-15 14:27:04.109: WARN/System.err(277):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
    06-15 14:27:04.109: WARN/System.err(277):     at com.psl.virtual.transport.HttpUtil.sendRequest(HttpUtil.java:41)
    06-15 14:27:04.109: WARN/System.err(277):     at com.psl.virtual.ui.VMLoginScreen.check(VMLoginScreen.java:98)
    06-15 14:27:04.109: WARN/System.err(277):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-15 14:27:04.109: WARN/System.err(277):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.View$1.onClick(View.java:2067)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.View.performClick(View.java:2408)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.View.onKeyUp(View.java:4121)
    06-15 14:27:04.109: WARN/System.err(277):     at android.widget.TextView.onKeyUp(TextView.java:4431)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.KeyEvent.dispatch(KeyEvent.java:1061)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.View.dispatchKeyEvent(View.java:3740)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
    06-15 14:27:04.109: WARN/System.err(277):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
    06-15 14:27:04.120: WARN/System.err(277):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
    06-15 14:27:04.120: WARN/System.err(277):     at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:788)
    06-15 14:27:04.120: WARN/System.err(277):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1667)
    06-15 14:27:04.120: WARN/System.err(277):     at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1102)
    06-15 14:27:04.120: WARN/System.err(277):     at android.app.Activity.dispatchKeyEvent(Activity.java:2063)
    06-15 14:27:04.120: WARN/System.err(277):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1643)
    06-15 14:27:04.120: WARN/System.err(277):     at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2471)
    06-15 14:27:04.120: WARN/System.err(277):     at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2441)
    06-15 14:27:04.130: WARN/System.err(277):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1735)
    06-15 14:27:04.130: WARN/System.err(277):     at android.os.Handler.dispatchMessage(Handler.java:99)
    06-15 14:27:04.130: WARN/System.err(277):     at android.os.Looper.loop(Looper.java:123)
    06-15 14:27:04.130: WARN/System.err(277):     at android.app.ActivityThread.main(ActivityThread.java:4627)
    06-15 14:27:04.130: WARN/System.err(277):     at java.lang.reflect.Method.invokeNative(Native Method)
    06-15 14:27:04.130: WARN/System.err(277):     at java.lang.reflect.Method.invoke(Method.java:521)
    06-15 14:27:04.130: WARN/System.err(277):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
    06-15 14:27:04.130: WARN/System.err(277):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
    06-15 14:27:04.130: WARN/System.err(277):     at dalvik.system.NativeStart.main(Native Method)
6
  • "<html" what XML you provided to Parser please check .. Commented Jun 15, 2012 at 9:05
  • can you please tell me where to find this declaration? Commented Jun 15, 2012 at 9:16
  • as in the first line of log cat i found (position:START_TAG <html dir='null'>@2:11 in java.io.InputStreamReader@44f4e7d0) so just said to print the response coming in log cat or any other place to check that Commented Jun 15, 2012 at 9:19
  • no i mean where to find "<html dir =" in code? Commented Jun 15, 2012 at 9:23
  • no, it would be in data which you are passing to parser...... Commented Jun 15, 2012 at 9:26

1 Answer 1

1

I've found 2 cases where the XmlPullParser does not like HTML being parsed - in the first case the HTML is valid and in the second case the HTML is invalid yet seems likely to occur:

1) unquoted attribute values as in:

<img class=logoimg ...

Yet the HTML (5.1) spec permits it:

Unquoted attribute value syntax The attribute name, followed by zero or more space characters, followed by a single U+003D EQUALS SIGN character, followed by zero or more space characters, followed by the attribute value, which, in addition to the requirements given above for attribute values, must not contain any literal space characters, any U+0022 QUOTATION MARK characters ("), U+0027 APOSTROPHE characters ('), U+003D EQUALS SIGN characters (=), U+003C LESS-THAN SIGN characters (<), U+003E GREATER-THAN SIGN characters (>), or U+0060 GRAVE ACCENT characters (`), and must not be the empty string.

In the following example, the value attribute is given with the unquoted attribute value syntax:

<input value=yes>

If an attribute using the unquoted attribute syntax is to be followed by another attribute or by the optional U+002F SOLIDUS character (/) allowed in step 6 of the start tag syntax above, then there must be a space character separating the two.

2) Attribute values separated by comma, as in:

<meta name=viewport content="width=device-width, initial-scale=1">

again from the spec:

If an attribute using the double-quoted attribute syntax is to be followed by another attribute, then there must be a space character separating the two.

The short of it is, the parsing code (i.e. the code using the XmlPullParser) needs to tolerate exceptional cases - particularly since the parser seems to keep on going nicely.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.