求大神啊--调用webservice时报错
我用Jsoup解析网页,代码在eclipse上可以成功,但是发布到tomcat上报错了public String getJWGG() {
URL getJWGG_url = null;
try {
getJWGG_url = new URL("http://202.203.194.10/jwnews/Default.aspx");
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//获取教务处公告的方法
String text = "" , title = "" , href = "";
Document doc = null;
try {
doc = Jsoup.parse(getJWGG_url, 6000);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// 提取table中的文本信息
Elements links = doc.select("table[id=Newnews1_DataList1]");
for (org.jsoup.nodes.Element link : links) {
//提取出地址
for(org.jsoup.nodes.Element link_address : link.select("a"))
{
//获取标题
title = link_address.attr("title");
//获取地址
href = "http://202.203.194.10/jwnews/"+link_address.attr("href");
text += "<li style=\"list-style:none; border-top:solid #CCC 1px;padding-top:0.5em; margin-bottom:0.5em;\" " +
"><a href=\"javascript:contact.sendTarget(\\'"+href+"\\')\">"+title+"</a></li>";
}
}
return text;
}
这个方法在eclipse上是可以成功的,但是在服务器上好像红字就报错了,下面是错误信息
我调用的时候显示了这个
SoapFault - faultcode: 'soapenv:Server' faultstring: 'org/jsoup/Jsoup' faultactor: 'null' detail: org.kxml2.kdom.Node@120540c
at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:136)
at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:137)
at org.ksoap2.transport.Transport.parseResponse(Transport.java:100)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:195)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
at 默认.Notice.getJWGG(Notice.java:33)
at 默认.Notice.main(Notice.java:83)
Exception in thread "main" java.lang.NullPointerException
at 默认.Notice.getJWGG(Notice.java:45)
at 默认.Notice.main(Notice.java:83)
webservice报错 android
补充:移动开发 , Android