📄 webserviceclient.java
字号:
package lee;
import org.apache.axis.client.*;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
/**
* @author yeeku.H.lee kongyeeku@163.com
* @version 1.0
* <br>Copyright (C), 2005-2008, yeeku.H.Lee
* <br>This program is protected by copyright laws.
* <br>Program Name:
* <br>Date:
*/
public class WebServiceClient
{
public static void main(String args[])
{
System.out.println("开始调用WebService");
try
{
String endpoint = "http://localhost:8888/axis/Hello.jws";
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("hello");
String s = (String)call.invoke(new Object[] {"中国人"});
System.out.println(s);
}
catch (Exception e)
{
System.out.println(e.toString());
}
System.out.println("调用WebService正常结束");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -