日期:2014-05-20 浏览次数:20615 次
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>servicename</name>
<namespace>http://localhost:8080/projectname/servicename</namespace>
<serviceClass>com.serviceinterface</serviceClass>
<implementationClass>com.serviceinterfaceimpl</implementationClass>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
</service></beans>
Service myService=new ObjectServiceFactory().create(serviceinterface.class);
XFire xFire=XFireFactory.newInstance().getXFire();
XFireProxyFactory xpFactory=new XFireProxyFactory(xFire);
String serviceUrl="http://localhost:8080/projectname/services/servicename";
Serviceinterface service=(Serviceinterface )xpFactory.create(myService, serviceUrl);
// service,这个对象就可以调用方法了。