testclient.java

来自「axis入门文档、代码 配置好jdk和tomcat」· Java 代码 · 共 20 行

JAVA
20
字号
package anni;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

public class TestClient {
   public static void main(String [] args) {
       try {
           String endpoint = "http://localhost:8080/axis/HelloWorld.jws";
           Service service = new Service();
           Call    call    = (Call) service.createCall();
           call.setTargetEndpointAddress(new java.net.URL(endpoint));           
           call.setOperationName(new QName("sayHello"));
           String ret = (String) call.invoke(new Object[]{});
           System.out.println(" got '" + ret + "'");
       } catch (Exception e) {
           System.err.println(e.toString());
       }
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?