读书人

求购关于webservice客户需调用有关问

发布时间: 2012-02-05 12:07:14 作者: rapoo

求购,关于webservice客户需调用问题


String serviceURL = "http://192.168.0.60:8080/sms/services/send?wsdl";

XFireProxyFactory serviceFactory = new XFireProxyFactory();


try {
Client client = new Client(new URL(serviceURL));
Object[] results = client.invoke("send", new String[]{"test","test","13616111666","短信内容"});
System.out.println(results[0]);

} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

上述代码是一个webservice的客户端程序,作发短信的测试用的,不知道哪儿有问题。错误提示是

org.codehaus.xfire.XFireRuntimeException: Could not find operation with name http://192.168.0.60:8080/sms/services/send
at org.codehaus.xfire.client.Client.invoke(Client.java:366)
at SmsClient.main(SmsClient.java:43)

请大虾们点拨指正哈


[解决办法]
Object[] results = client.invoke("send", new String[]{"test","test","13616111666","短信内容"});


改成

Object[] results = client.invoke("Send", new String[]{"test","test","13616111666","短信内容"});

读书人网 >Java相关

热点推荐