日期:2014-05-20  浏览次数:20714 次

求购,关于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","短信内容"});