今天做Ace Metrix Android 项目,发现了一个以前那个问题又出现了:
06-13 06:27:15.401: WARN/System.err(577): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in java.io.InputStreamReader@43ecfbd0)
06-13 06:27:15.401: WARN/System.err(577): at org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
06-13 06:27:15.410: WARN/System.err(577): at org.kxml2.io.KXmlParser.require(KXmlParser.java:1431)
06-13 06:27:15.410: WARN/System.err(577): at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127)
06-13 06:27:15.421: WARN/System.err(577): at org.ksoap2.transport.Transport.parseResponse(Transport.java:90)
06-13 06:27:15.421: WARN/System.err(577): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:179)
06-13 06:27:15.432: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:195)
06-13 06:27:15.442: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.442: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.442: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.452: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.461: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.461: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:213)
06-13 06:27:15.471: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.makeCall(WSDLClient.java:176)
06-13 06:27:15.471: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.invokeMethod(WSDLClient.java:128)
06-13 06:27:15.491: WARN/System.err(577): at com.ceosoft.acemetrix.wsdl.WSDLClient.getDailyTop5(WSDLClient.java:227)
06-13 06:27:15.491: WARN/System.err(577): at com.ceosoft.acemetrix.data.manager.DataManager$1.launch(DataManager.java:161)
06-13 06:27:15.503: WARN/System.err(577): at com.ceosoft.acemetrix.data.DataTask.doInBackground(DataTask.java:74)
06-13 06:27:15.512: WARN/System.err(577): at com.ceosoft.acemetrix.data.DataTask.doInBackground(DataTask.java:1)
06-13 06:27:15.512: WARN/System.err(577): at android.os.AsyncTask$2.call(AsyncTask.java:185)
06-13 06:27:15.512: WARN/System.err(577): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
06-13 06:27:15.522: WARN/System.err(577): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
06-13 06:27:15.522: WARN/System.err(577): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
06-13 06:27:15.532: WARN/System.err(577): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
06-13 06:27:15.532: WARN/System.err(577): at java.lang.Thread.run(Thread.java:1096)
实在是蛋疼啊,这个问题好久没有出现了,上次出现,解决方法是 捕捉异常,再重发请求。
今天又遇到,又搞了半天,也搞不出来,没有办法,看看iPhone的实在,才发现,也存在同样的问题:“Bad gateway”,
唉,后台在维护所导致的,唉,命真苦,做外包的人,真是伤不起,后台的人维护怎么也不通知一下呢,至少发个Email给我们这些做前端的人啊(后台不在我们公司)
自己的解决方案:
catch一下这个异常,捕捉到后,重新发一次请求,注意返回值的递归(重点注意啊)
特别注意:(2012-10-19)
这个问题是我很久以前遇到的,我没有做什么特殊的处理,只是发现这个时有时无,断定跟网络状态有关,所以注catch异常了之后 ,重新向后台请求一次数据。多请求几次,最终总能得到正常的数据返回!
本人的解决方法自知有欠缺,望诸位见谅。尽管与诸君所遇异常信息头相同,可是我们各自遇到的问题却是有千差万别的!