求webservice 调用示例
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>
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,这个对象就可以调用方法了。