android web services5

急救,困扰我多天了: 开发android应用,通过ksoap2调用java的webservice,结果报错

浏览次数:1044次 悬赏分:10 | 提问时间:2010-10-29 19:20 | 提问者:aries_jwz | 检举
急救,困扰我多天了: 开发android应用,通过ksoap2调用java的webservice,结果报错如下:
10-29 11:15:57.315: ERROR/AutoUpdate(26243): expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/
}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/
}wsdl:definitions targetNamespace='http://service.ct.com
'>@2:469 in java.io.InputStreamReader@43ba4600) 
10-29 11:15:57.315: ERROR/AutoUpdate(26243): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/
}Envelope (position:START_TAG <{http://schemas.xmlsoap.org/wsdl/
}wsdl:definitions targetNamespace='http://service.ct.com
'>@2:469 in java.io.InputStreamReader@43ba4600)
推荐答案
http://cache.baidu.com/c?m=9d78d513d99e01fa4fece4690d61c067691edf3d7e908e4b68d5e35f93134c403722e0ac26520704a4d27d174bf0171eadae6830644361e0db9fc21b8af9d47372d43035000b873205d269f88104729066c70cfeae69f0bb832593df93958c1415dd52756d87849c5b7052993ae45371bda9
c30e531d07bb9e2d78a5026029e87313ed11bef7321956dca9c00b1096718c621196a932b43b18be0ef441467159fb0ae6574c2035e14877af123d0293ea0ae0217b1422e61cb2e895b3e95f8cabb077c7a4&p=8b2a950a9e8b04bc08e2977f4842&user=baidu

org.xmlpull.v1.XmlPullParserException:expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/
}Envelope 在做android程序时莫名其妙地出现了这个问题,google了半天没有结果,只有一个兄弟说什么“是ksoap无法解析服务器端这种类型的xml,所以报错。”但是没有弄明白是怎么回事。后来仔细看服务器端的代码,关于版本有两个soap 1.1和soap1.2.然而在具体的xml中却赫然写着<?xml version="1.0" encoding="utf-8"?>这个version又是什么呢?不明白,索性试试看:将SoapSerializationEnvelope envelope=new SoapSerializationEnvelope(SoapEnvelope.VER12); 中的VER从12改到11不行,再改到10,成功!

你可能感兴趣的:(web services)