如何调用WebService 用java 调用吗 还是????用java的话 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 String endpoint = "https://ip:" +端口+ "/axis/services/服务名称"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName("toString"); String res = (String) call.invoke( new Object[] {} ); System.out.println( res); 上面给的代码是使用的axis,其实webservice有很多工具可供选择,http://www.jopener.cn/category/web-services-tools/ 你好我想请问一下这句话是什么意识,String res = (String) call.invoke( new Object[] {} );服务端提供了一个方法让我调用,上面的这句话就可以调用吗?能不能帮我 讲一下,谢谢!谢谢! 大哥call.setOperationName("toString");是设置方法名吗? 大哥客户端开发需不需要根据wsdl生 成java文件。 LZ首先呢,对于你这个问题,我只能说:有些帽子太大了,范围太大了。你作为客户端,但是这个客户端是什么呢,laszlo?flex?java?还是别的什么呢?,但是话又说回来,不管是什么的客户端,不外乎你要知道wsdl定义的服务,并且知道wsdl的类型(所谓的文字/文档、RPC/文档、文字/编码、RPC/编码),这些个都是基础性概念。 String endpoint = "https://ip:" +端口+ "/axis/services/服务名称"; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setOperationName("toString"); String res = (String) call.invoke( new Object[] {} ); System.out.println( res);大哥我要传参数怎么传,这样可不可以String res = (String) call.invoke( new Object[] {“aaa”,“bbb”} );需不需要专们的参数类型。 public class AXISTest { public static void main(String[] args) throws Exception { Service service = new Service(); Call call = (Call) service.createCall(); //////////访问即时发布的Distance服务 //设置访问点 call.setTargetEndpointAddress("http://150.236.80.78:7001/EUPortal/webservice/tcqi.jws"); //设置操作名 call.setOperationName("getDeviceInformation"); //设置入口参数 call.addParameter("deviceName", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_ANYTYPE); String d1 = "NokiaS60"; GetDeviceInformationOutput resp = (GetDeviceInformationOutput) call.invoke(new Object[] { d1 }); } } j2ee 牛人来帮忙 新手来学习 struts2中的list有[]时(list不全是[])freemarker就不能输出,为什么?请高手指点! UrlRewrite带参数的url静态化问题 ie显示xml文件的问题 请教sruts 1.x 问题 使用hbm2dll,遇到问题,请高手指点下 通过jsp页面生成List对象 有关于javabean也ajax传值 hibernate中的query查询和criteria查询的效率那个高呢,一般用谁呢? 安装J2SE能使用EJB吗? 问一个有JPQL order by 枚举类型的问题!! hibernate hql 查询问题
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName("toString");
String res = (String) call.invoke( new Object[] {} );
System.out.println( res);
其实webservice有很多工具可供选择,http://www.jopener.cn/category/web-services-tools/
String res = (String) call.invoke( new Object[] {} );
服务端提供了一个方法让我调用,上面的这句话就可以调用吗?能不能帮我 讲一下,谢谢!谢谢!
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName("toString");
String res = (String) call.invoke( new Object[] {} );
System.out.println( res);大哥我要传参数怎么传,
这样可不可以String res = (String) call.invoke( new Object[] {“aaa”,“bbb”} );
需不需要专们的参数类型。
public static void main(String[] args) throws Exception {
Service service = new Service();
Call call = (Call) service.createCall();
//////////访问即时发布的Distance服务
//设置访问点
call.setTargetEndpointAddress("http://150.236.80.78:7001/EUPortal/webservice/tcqi.jws");
//设置操作名
call.setOperationName("getDeviceInformation");
//设置入口参数
call.addParameter("deviceName", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_ANYTYPE);
String d1 = "NokiaS60";
GetDeviceInformationOutput resp = (GetDeviceInformationOutput) call.invoke(new Object[] { d1 });
}
}