webservice
------最佳解决方案--------------------------------------------------------
http://download.csdn.net/download/TrimRay/858350
自己看看
------其他解决方案--------------------------------------------------------
用xfire:
在webservice工程里指定好:
<?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>
再把接口打包。添加到web工程里
在你的web工程里调用:
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,这个对象就可以调用方法了。