📄 serviceclient.java
字号:
package com.liuyang.axis.client;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
public class ServiceClient {
public static void main(String[] args) throws Exception {
String endpoint = "http://localhost:8080/axis/services/HelloService";
String name = "liuyang";
Service service = new Service();
Call call = (Call) service.createCall();
call.setUsername("user1");
call.setPassword("pass1");
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( "sayHello" );
call.addParameter( "param1", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_STRING );
String ret = (String) call.invoke( new Object [] { name });
System.out.println("返回结果 : " + ret);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -