⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sessionclient.java

📁 webservices axis文档 例子
💻 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 + -