?? wsclient.java
字號:
package com.fubao.testwsclient;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;
import com.fubao.testws.Course;
import com.fubao.testws.HelloService;
import com.fubao.testws.User;
public class WSClient {
/**
* @param args
*/
public static void main(String[] args) {
Service srvcModel = new ObjectServiceFactory().create(HelloService.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
String helloWorldURL = "http://localhost:8088/testWS/services/HelloService";
try {
//HelloService srvc = ((HelloService) factory.create(srvcModel,helloWorldURL));
String hellostring = ((HelloService) factory.create(srvcModel,helloWorldURL)).sayHello("lifubao");
System.out.println(hellostring);
/*System.out.println(srvc.sayHello("Robin"));
User u=new User();
u.setName("RRRRR");
Course c=srvc.choose(u);
System.out.println(c.getName());
List al=new ArrayList();
al.add("1212");
al.add("2222");
List t=srvc.test(al);
for (int i = 0; i < t.size(); i++) {
Course co=(Course)t.get(i);
System.out.println(co.getName());
} */
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -