加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

axis webservice总结

发布时间:2020-12-17 01:27:11 所属栏目:安全 来源:网络整理
导读:axis调用webservice的方法 : 1. RPC方式 package com.elfenlied.getWebService; import javax.xml.namespace.QName; import org.apache.axis2.AxisFault; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options;

axis调用webservice的方法

1.RPC方式

package com.elfenlied.getWebService;

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 GetHelloClient {

??? /**
??? ?* @param args
??? ?* @throws AxisFault
??? ?*/
??? public static void main(String[] args) throws AxisFault {
??? ??? RPCServiceClient r = new RPCServiceClient();
??? ??? Options options = r.getOptions();
??? ??? EndpointReference targetEpr = new EndpointReference("http://127.0.0.1:8080/axis2/services/HelloClient");
??? ??? options.setTo(targetEpr);
??? ??? Object[] objs = new Object[]{"不解释"};
??? ??? Class[] classes = new Class[]{String.class};
??? ??? QName qname = new QName("http://ws.apache.org/axis2","greeding");

??????? //1.调用的方法名,2.参数值列表3,类型列表 ??? ??? System.out.println(r.invokeBlocking(qname,objs,classes)[0]); ??? } }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读