XFIRE_WEBSERVICES实例
服务器端
?
接口
?
?
?
客户端调用
package com.client;import java.net.MalformedURLException;import org.codehaus.xfire.XFireFactory;import org.codehaus.xfire.client.XFireProxyFactory;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.binding.ObjectServiceFactory;public class Client {public static void main(String[] args) {String webserviceUrl="http://localhost:8083/webservice/services/test";Service serv=new ObjectServiceFactory().create(IInfo.class); XFireProxyFactory xfile=new XFireProxyFactory(XFireFactory.newInstance().getXFire()); IInfo info=null; try{info = (IInfo)xfile.create(serv, webserviceUrl);String hello=info.sayHello("hello");System.out.println(hello); }catch(MalformedURLException e){}}}?
?
?
?
详见附件,有疑问可以加我QQ:739921140