📄 echoclient.java
字号:
package com.webservice;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class EchoClient
{
public static void main(String args[])
{
try
{
String endpoint="http://127.0.0.1:8080/ch21/services/EchoService";
Service service=new Service();
Call call=(Call)service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(new QName("http://soapinterop.org/jjjj", "echo"));
call.addParameter("in0",
org.apache.axis.Constants.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_STRING);
// String ret=(String)call.invoke(new Object[]{"Hello"});
String ret=(String)call.invoke(new Object[]{"hhhhhh"});
System.out.println("发送了 Hello,收到了"+ret);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -