me 调用webservice出现的错误,大家过来看看

xuyan87101 2009-12-21 03:28:32
org.kxml.io.ParseException: unexpected: StartTag <html> line: -1 attr: [] @-1:-1
at org.kxml.parser.AbstractXmlParser.read(+53)
at org.ksoap.SoapEnvelope.parseHead(+19)
at org.ksoap.SoapEnvelope.parse(+5)
at org.ksoap.transport.HttpTransport.call(+372)
at org.ksoap.transport.HttpTransport.call(+12)
at StringProcessorStub.process(+41)
at DisplayForm.run(+19)

下面是调用的程序:
rpc.addProperty("name", name);
HttpTransport ht = new HttpTransport ("http://192.168.1.125/StringProcess", "");
result = (String) ht.call(rpc);

大家帮忙看看,呵呵呵……谢谢啊
...全文
131 点赞 收藏 10
写回复
10 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xiaoshanhui 2010-08-17
LZ 为什么我的result = (String) ht.call(rpc);报错?
The method call(String, SoapEnvelope) in the type HttpTransport is not
applicable for the arguments (SoapObject)
回复
xuyan87101 2009-12-29
嗯,是的,呵呵……谢谢
回复
踏雪耗子 2009-12-29
SoapObject rpc = new SoapObject("http://192.168.1.125:90/Service.asmx","Test");
你确定你的接口名是Test?
回复
踏雪耗子 2009-12-29
SoapObject req = new SoapObject(url, method);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.bodyOut = req;
HttpTransport httpTransport = new HttpTransport(url);
httpTransport.debug = true;
httpTransport.call
Object obResponse = envelope.getResponse();
回复
踏雪耗子 2009-12-28
HttpTransport ht = new HttpTransport ("http://192.168.1.125:90/Service.asmx","");
没传接口方法名啊~~
回复
xuyan87101 2009-12-22
厄,来个高手啊,呵呵……
回复
xuyan87101 2009-12-21
public String process(String name) {
String result = null;
try {
SoapObject rpc = new SoapObject("http://192.168.1.125:90/Service.asmx","Test");
rpc.addProperty("name",name);
System.out.println("sss");
HttpTransport ht = new HttpTransport ("http://192.168.1.125:90/Service.asmx","");
System.out.println("ssss");
result = (String) ht.call(rpc);
}
catch (Exception e) {
e.printStackTrace();
}

return result;
}
这个是调用的整个调用webservice的程序,方法和参数都一样,还是出现这个错误,呵呵%
回复
pjw100 2009-12-21
返回的xml打印出来是什么?xml能打印出来吗?
回复
xuyan87101 2009-12-21
嗯,是的
回复
踏雪耗子 2009-12-21
[Quote=引用楼主 xuyan87101 的回复:]
org.kxml.io.ParseException: unexpected: StartTag <html> line: -1 attr: [] @-1:-1
at org.kxml.parser.AbstractXmlParser.read(+53)
at org.ksoap.SoapEnvelope.parseHead(+19)
at org.ksoap.SoapEnvelope.parse(+5)
at org.ksoap.transport.HttpTransport.call(+372)
at org.ksoap.transport.HttpTransport.call(+12)
at StringProcessorStub.process(+41)
at DisplayForm.run(+19)

下面是调用的程序:
rpc.addProperty("name", name);   
HttpTransport ht =  new HttpTransport    ("http://192.168.1.125/StringProcess", "");     
result = (String) ht.call(rpc);

大家帮忙看看,呵呵呵……谢谢啊
[/Quote]


服务器提供的接口参数怎么写的?是name吗?你要跟服务器的参数定义的一样顺序也要一致~~~
回复
发动态
发帖子
J2ME
创建于2007-09-28

1.3w+

社区成员

Java J2ME
申请成为版主
社区公告
暂无公告