问题描述
新学webservice,实在不知道啥意思,客户端代码如下:importorg.apache.axis2.AxisFault;importorg.apache.axis2.rpc.client.RPCServiceClient;importorg.apache.axis2.addressing.EndpointReference;importorg.apache.axis2.client.Options;importjavax.xml.namespace.QName;publicclassclientMain{/***@paramargs*@throwsAxisFault*/publicstaticvoidmain(String[]args)throwsAxisFault{//TODOAuto-generatedmethodstub//调用webservice的urlStringpath="http://10.207.10.52:8080/axis2/services/simpleServer";//使用RPC的方式调用webserviceRPCServiceClientserviceClient=newRPCServiceClient();Optionsoptions=serviceClient.getOptions();EndpointReferencetarget=newEndpointReference(path);options.setTo(target);Object[]params=newObject[]{"ladygaga"};Class[]classes=newClass[]{String.class};QNameq=newQName(path,"simpleMethod");Objectobj=serviceClient.invokeBlocking(q,params,classes)[0];System.out.println(obj.toString());}}报错信息如下:Exceptioninthread"main"java.lang.NoClassDefFoundError:org/apache/woden/resolver/URIResolveratorg.apache.axis2.deployment.ModuleDeployer.deploy(ModuleDeployer.java:60)atorg.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)atorg.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)atorg.apache.axis2.deployment.RepositoryListener.loadClassPathModules(RepositoryListener.java:195)atorg.apache.axis2.deployment.RepositoryListener.init2(RepositoryListener.java:70)atorg.apache.axis2.deployment.RepositoryListener.<init>(RepositoryListener.java:63)atorg.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:164)atorg.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:135)atorg.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:68)atorg.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:184)atorg.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:150)atorg.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:143)atorg.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:244)atorg.apache.axis2.rpc.client.RPCServiceClient.<init>(RPCServiceClient.java:48)atclientMain.main(clientMain.java:19)
解决方案
解决方案二:
没人知道吗?
解决方案三:
少包?path后面不是要跟一个?WSDL吗?我也是刚学
解决方案四:
path后面不需要加?wsdl你这个应该是缺少woden-api-1.0MB.jar和woden-impl-dom-1.0MB.jar这两个包,你试试