日期:2014-05-20 浏览次数:20814 次
public String sayHello(String str); public String login(User user);
Exception in thread "main" java.lang.NoClassDefFoundError at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.class$(DefaultTypeMappingRegistry.java:64) at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.createDefaultMappings(DefaultTypeMappingRegistry.java:406) at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.createDefaultMappings(DefaultTypeMappingRegistry.java:311) at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.<init>(DefaultTypeMappingRegistry.java:131) at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.<init>(DefaultTypeMappingRegistry.java:137) at org.codehaus.xfire.aegis.type.DefaultTypeMappingRegistry.<init>(DefaultTypeMappingRegistry.java:118) at org.codehaus.xfire.aegis.AegisBindingProvider.<init>(AegisBindingProvider.java:67) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.codehaus.xfire.service.binding.ObjectServiceFactory.getBindingProvider(ObjectServiceFactory.java:173) at org.codehaus.xfire.service.binding.DefaultServiceConfiguration.getInParameterName(DefaultServiceConfiguration.java:162) at org.codehaus.xfire.service.binding.ObjectServiceFactory.getInParameterName(ObjectServiceFactory.java:1063) at org.codehaus.xfire.service.binding.ObjectServiceFactory.addOperation(ObjectServiceFactory.java:817) at org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeOperations(ObjectServiceFactory.java:761) at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:444) at test.arws.com.webServiceTest.main(webServiceTest.java:20) Caused by: java.lang.ClassNotFoundException: org.jdom.Element at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) ... 20 more
Client client; try { client = new Client(new URL( "http://localhost:8080/A/services/Service?wsdl")); Object[] results = client .invoke("sayHello", new Object[] { "Firends" }); System.out.println(results[0]); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }