请教,pb8.0调用webservice返回参数的问题

2024-12-24 14:40:30
推荐回答(1个)
回答1:

package xfire;import org.codehaus.xfire.XFire;import org.codehaus.xfire.client.XFireProxyFactory;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.service.binding.ObjectServiceFactory;public class XFireTest {public static void main(String[] args) {try {String url = "Hello" ;Service service = new ObjectServiceFactory().create(IAnyName.class) ;//XFire fire=XFireFactory.newInstance().getXFire();//XFireProxyFactory factory=new XFireProxyFactory(fire);XFireProxyFactory factory = new XFireProxyFactory() ;IAnyName hello = (IAnyName) factory.create(service,url) ;String str = hello.hello("rcfeng","Parameter two") ;System.out.println(str);} catch (Exception e) {e.printStackTrace();}}}以上是XFire客户端访问WebService的实例