码迷,mamicode.com
首页 > 编程语言 > 详细

Java调用接口

时间:2015-07-06 15:37:52      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

importjavax.xml.namespace.QName;
import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
importorg.apache.axis2.client.ServiceClient;
import org.apache.axis2.rpc.client.RPCServiceClient;

publicclassWebserviceTest {
    publicstaticvoid main(String[] args) {
        
        RPCServiceClientserviceClient;
        try {
            serviceClient = newRPCServiceClient();
             Options options = serviceClient.getOptions();  
            //指定调用WebService的URL  
            EndpointReferencetargetEPR = newEndpointReference("");  
            options.setTo(targetEPR);  
//参数说明:
QNameopAddEntry = newQName("http://ws.apache.org/axis2", "pushData");
//调用pushData方法并输出该方法的返回值 System.out.println(serviceClient.invokeBlocking(opAddEntry, opAddEntryArgs, classes)[0]);
}
catch (AxisFault e) { e.printStackTrace(); } }

 

Java调用接口

标签:

原文地址:http://www.cnblogs.com/nyist2007/p/4624279.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!