求助!Web Service客户端问题!开发好的web服务,调用时有问题!求指教!

robin_jh 2012-05-18 09:12:48
我开发好了一个web服务,url是http://localhost:8080/Machining,对外开放的接口是要接收三个double型的数据,但是我编写客户端的时候,出错,请大家指教!

package client;

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;

public class WebClient {

public static void main(String[]args1)throws AxisFault{
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();

EndpointReference targeERP= new EndpointReference("http://localhost:8080/Machining");
options.setTo(targeERP);

QName opGetMilling = new QName("http://server","milling");//milling是要调用的操作名
Class[] returnTypes = new Class[]{double.class};

Object[] opGetMillingArgs = new Object[]{2,3,4};

Object[] response =serviceClient.invokeBlocking(opGetMilling,opGetMillingArgs,returnTypes);
double result = (double)response[0];

if(result==0){
System.out.println("服务调用失败");
return;
}

System.out.println(result);
}

}
...全文
42 回复 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,997

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧