📄 authenclient.java
字号:
package anni;
import javax.xml.namespace.QName;
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 AuthenClient {
public static void main(String [] args) throws Exception {
Log log = LogFactory.getLog(AuthenClient.class);
String endpointURL = "http://localhost:8080/axis/services/HandleredService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
call.setOperationName(new QName("HandleredService", "publicMethod"));//设置操作的名称。
//由于需要认证,故需要设置调用的用户名和密码。
call.getMessageContext().setUsername("lingo");
call.getMessageContext().setPassword("lingo");
String res = (String) call.invoke( new Object[] {"Lingo"} );
log.info( res );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -