?? authorclient.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 AuthorClient {
public static void main(String [] args) throws Exception {
Log log = LogFactory.getLog(AuthorClient.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"));//設(shè)置操作的名稱。
//由于需要認(rèn)證,故需要設(shè)置調(diào)用的用戶名和密碼。
call.getMessageContext().setUsername("anni");
call.getMessageContext().setPassword("123456");
String res = (String) call.invoke( new Object[] {"Lingo"} );
log.info( res );
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -