📄 sessionclient.java
字号:
package anni.session;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class SessionClient {
public static void main(String [] args) throws Exception {
Log log = LogFactory.getLog(SessionClient.class);
String endpoint = "http://localhost:8080/axis/services/SessionService";
Service service = new Service();
service.setMaintainSession(true);
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("echo");
String res = (String) call.invoke(new Object[]{"lingo"});
System.out.println(res);
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("echo");
res = (String) call.invoke(new Object[]{"sophia"});
System.out.println(res);
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("echo");
res = (String) call.invoke(new Object[]{"swallow"});
System.out.println(res);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -