【webservice】818开发webservice过程中遇到的异常

抛出无法找到主类:org.apache.axis.wsdl.WSDL2Java 在使用Idea根据wsdl自动生成java code的时候;抛出无法找到主类:org.apache.axis.wsdl.WSDL2Java(Throws Could not find main class: org.apache.axis.wsdl.WSDL2Java)。 添加本文的jar包压缩包解压出来的所有jar包到当前使用的java.exe 命令的lib目录下的ext目录中即可解决。 立即下载

还是关于axis2的知识哦。webservice的开发,包括服务端的开发、客户端的开发。在“服务端的开发”方面通常是部署好axis2的环境、完成工程的设计与编程、打包发布,一般来说不会出现异常(前提是基本功扎实),然而,在“客户端的开发”方面就不好说了。下面就简单说一下客户端开发可能会出现的问题吧。

1、生成客户端代码时报错。例如用axis2的生成工具去搞axis1的wsdl(这个可以参考前面的博文哦),报错信息是org.apache.axis2.wsdl.codegen.CodeGenerationException  : java.lang.RuntimeException: java.lang.reflect.InvocationTargetException。网上的说法一致是wsdl有问题,说法是正确的,但不够详细。后来webservice服务端厂家提示要用axis1的生成工具,这才解决了问题。貌似没看到其他朋友有这样的遭遇呢,犯错就是学习,呵呵。

2、axis2生成CXF的webservice的wsdl。有一次遇到一个wsdl,和平时看的axis2的wsdl有点不一样,而最后还是可以顺利生成客户端代码,也就是stub类。但是,拿到了这个stub类,却不能和平常一样写客户端代码(平常的做法是,new一个stub类对象,直接调用其子类、子方法就完事了)。后来有群友帮忙,才知道这是csf生成的wsdl,热心的群友还帮我生成了cxf的客户端代码。可是我用axis2的啊,但是还是非常感谢他。再后来,我问厂家拿了报文,根据报文的xml(是soap协议的)一步一步调用才解决了问题。说多了都是泪,直接上代码:

//set值过程  --- 注意参考报文
ISPPNPIServiceStub sub = new ISPPNPIServiceStub();
ISPPNPIServiceStub.Root rootSend = new ISPPNPIServiceStub.Root();
ISPPNPIServiceStub.Msg_head rMsg_head = new ISPPNPIServiceStub.Msg_head();
ISPPNPIServiceStub.Interface_msg rInterfaceMsg = new ISPPNPIServiceStub.Interface_msg();
ISPPNPIServiceStub.Directive rDirective = new ISPPNPIServiceStub.Directive();
ISPPNPIServiceStub.ServiceClass rServiceClass = new ISPPNPIServiceStub.ServiceClass();
ISPPNPIServiceStub.ServiceSubClass rServiceSubClass = new ISPPNPIServiceStub.ServiceSubClass();
ISPPNPIServiceStub.Method rMethod = new ISPPNPIServiceStub.Method();
rMsg_head.setTime("String");
rMsg_head.setFrom("String");
rMsg_head.setTo("String");
rMsg_head.setMsg_type("String");
rMsg_head.setSerial(ipString);
rMethod.setName("IssuePpcCard");//对于报文:<Method Name="IssuePpcCard"> 
rMethod.setMDN(number);
rMethod.setPWD(pwd);
rServiceSubClass.setName("CSPpcMemberService");
rServiceSubClass.setName("CSService");
rServiceSubClass.setMethod(rMethod);
rServiceClass.setServiceSubClass(rServiceSubClass);
rDirective.setServiceClass(rServiceClass);
rInterfaceMsg.setDirective(rDirective);
rootSend.setInterface_msg(rInterfaceMsg);
rootSend.setMsg_head(rMsg_head);
				
ISPPNPIServiceStub.Root rootRS = sub.SYNNPIAPI(rootSend, null, null, null, null);
ISPPNPIServiceStub.ResponseSubClass responseSubClass = new ISPPNPIServiceStub.ResponseSubClass();
responseSubClass = rootRS.getInterface_msg().getMsg_response().getResponseClass().getResponseSubClass();
				
String returnData = JSONObject.fromObject(responseSubClass).toString();

3、查询超时。这个异常就是connect timeout了,因为服务端数据量太大,查询速度慢,返回数据也比较多,整个调用过程超出了默认的时间,解决办法是在生成的stub类的构造函数(有多个哦,别弄错了哦)里面添加这行: _serviceClient.getOptions().setTimeOutInMilliSeconds(600000L);//10 mins timeout。这样一来,stub类实例化的时候会重设连接时间。

4、出现常见的 nullPointException、sqlException等等,那估计就是自己的代码有问题了。

总而言之:服务端开发一般不出错;客户端开发时,先问厂家拿wsdl和url,调不通就问厂家拿报文就是了,如果拿了报文后还是怎么弄也弄不好?最后一招:放弃axis,直接写servlet(也就是要弄javaweb系统了)!

老鸟勿喷哦~ 转载请说明出自whilejolly:http://blog.youkuaiyun.com/seedingly/article/details/39052189

PC微信(3.9.2.23)逆向实战:定位并Hook消息接收函数 本文详细介绍了PC微信(3.9.2.23)逆向分析中定位并Hook消息接收函数的完整实战流程。通过Cheat Engine动态定位未读消息数内存地址,结合OllyDbg分析代码上下文,最终找到稳定的Hook点,并分享了实战中的关键注意事项与踩坑经验。 阅读详情

相关推荐

CAN通信:EB中配置CAN驱动,配置参数解析

以S32K314芯片说明,其他芯片不同,参数配置也有差异。

zhangxiaio1的博客 2174

java axis2 编码_Axis2的wsdl2java在RPC /编码样式的Web服务上失败

Retrieving document at '...'.Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetExceptionat org.apache.axis...

weixin_42412850的博客 489

国产操作系统应用迁移与适配

了解国产操作系统的背景及意义

2301_77609559的博客 2683

通过wsdl2java命令生成客户端代码,遇到的问题

通过wsdl2java命令生成客户端代码,遇到的问题。 我输入的命令:wsdl2java -d g:/ws -p com.etoak.client http://localhost:8080/Spring_Springmvc_Mybatis/ws/user?wsdl 但是总是遇到下面的异常: WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeEx...

weixin_44180412的博客 4150

库卡C4控制柜首次上电

本文详细介绍了如何使新购的库卡机器人(以KRC4为例)达到正常运行状态。首先,必须正确连接机器人尾部和控制柜底部的各种线缆,包括动力线缆、编码器线、SmartPad线和安全回路线缆等。特别强调,电源线和蓄电池线的正确连接至关重要,避免硬插以防损坏。此外,机器人与控制柜之间需连接地线以防止漏电。文章还提到,开机前需检查电机保护器开关,并确保所有线路连接正确。开机后,需提升用户权限至安全维护员级别,通过系统配置激活安全相关通讯参数。最后,文章详细解释了X11安全回路的接线方式,强调双通道信号的重要性,并提醒不同

2202_75959322的博客 1847

PySWMM新手避坑指南:从安装到批量处理INP文件的完整流程(附常见错误解决方案)

本文为PySWMM新手提供从环境搭建到批量处理INP文件的完整避坑指南。详细讲解了虚拟环境配置、库安装方法,并针对“无法打开输入文件”和对象访问错误等高频问题提供解决方案。核心部分展示了如何利用Python脚本实现INP文件的批量运行、结果汇总以及参数自动化修改,显著提升SWMM模型的工作效率。

weixin_29092031的博客 393

axis2 wsdl2java 报错_线程“main”中的异常org.apache.axis2.wsdl.codegen.CodeGenerationException:无效的WSDL?...

尝试生成Web服务客户端存根时遇到以下错误...当我登录到Apache Admin页面时,我可以看到Web服务和'http:// localhost:8080 / axis2 / services / HelloWorldService?wsdl'的服务终点 - 为什么WSDL2Java.bat文件找不到wsdl文件..?C:\AAA\HelloWorld\client\client>WSD...

weixin_39649736的博客 814

【Unity 实用工具篇】✨| I2 Localization 实现本地化及多种语言切换,快速上手

Unity的多语言本地化是一个很实用的功能,它可以帮助游戏支持多种语言,让不同语言的玩家都能够更好地体验游戏。 而实现本地化的方案也有很多种,各个方案之间也各有优劣,后面也会对多个方案进行介绍学习。 本文就来介绍一个专门作用于多语言本地化的插件:I2 Localization 。

努力前行,总会成为自己心中的那道光 3万+

关于学习WebService的cxf问题 指令wsdl2java 相关错误

错误:----Exception in thread “main” java.lang.UnsupportedClassVersionError: org/apach…version52.0 查阅后发现是因为java版本不一致,使用wsdl2java命令时报错,cxf是java语言编写的,当编译cxf的编译器是的版本大于你当前使用的jdk的版本时会报错,你的jvm不能理解比你现在版本高得哪些jdk的新特性. **解决:**降低cxf的版本或是提升jdk版本,前者容易实现一些 附上历史版本链接:cxf历史版本

pepper5的博客 2523

BMP390L数字大气压传感器原理图设计,已量产(压力传感器)

在工业设备的室内定位、地下设施监测这类 GPS 信号盲区场景里,气压高度检测的 “靠谱程度” 直接决定了系统的可用性 —— 毕竟谁也不想在地下停车场导航时,设备把 1 楼误判成 3 楼。最近在项目里基于博世 BMP390L 做了硬件电路设计,正好聊聊这款工业级数字气压传感器的硬实力,以及原理图里的那些关键设计细节。

不脱发的程序猿 356

2024美团秋招硬件开发笔试真题及答案解析

在 Linux 内核的网络设备驱动中,数据链路层的功能通常由网络协议栈的低层(如以太网驱动)实现,而不是作为网络设备驱动的一个独立层次。在 FreeRTOS 中,任务通知(Task Notifications)是一种轻量级的事件传递机制,用于在任务之间或任务与中断之间传递信号。小美正在开发一个简单的密码生成器,其中一个功能是将输入的字符串中的所有字母按字母顺序循环前移一位(即 'a' 变为 'z','B' 变为 'A',以此类推)。它包含了网络设备的各种参数和方法,用于管理网络设备的初始化、配置和操作。

XU157303764的博客 1681

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException : Error parsing WSD

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException : Error parsing WSDL Caused by: java.net.UnknownHostException:  等此类问题都是由于写错了要调用的webservice 的targetNamespace 引起的!

6411

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

利用Soap2调用webService接口用AS打包后出错小结

项目中用到了xStream将对象封装成xml进行通讯的功能,这里用到了测试一切都正常,将项目用AndroidStudio打包后发现app中总是包连不上网

木头小颖的博客 924

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

java.lang.IllegalArgumentException: argument type mismatch

1:MyEclipse控制台: java.lang.IllegalArgumentException: argument type mismatch     2:浏览器页面:   javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(Reques...

gaogexuandengmei的博客 350

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

WSDL教程

一、Introduction to WSDL WSDL is an XML-based language for describing Web services and how to access them. What You Should Already Know Before you continue you should have a basic understan

SlimApp 1121

cxf3.2 wsdl2java异常_cxf工具wsdl2java生成客户端代码错误,,急,遇到过的给看看麻烦各位大神了...

使用cxf的工具wsdl2java工具命令如下C:\Users\Administrator>e:E:\>cd E:\zkr.code\weather\srcE:\zkr.code\weather\src>wsdl2java -all http://ws.webxml.com.cn/WebServices/WeatherWS.asmx?wsdlWSDLToJava Error: h...

weixin_42252435的博客 1083

java调用webservice的2种方式代码

webservice有提供wsdl跟asmx两种方式,两种方式的调用方法不同 1、wsdl的方式 添加依赖: <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <v...

seapeak007的博客 2476

WSDL2Java问题

项目中要根据另一个系统提供的wsdl文件生成java文件,用WSDL2Java插件根据WSDL生成java过程中提示错误信息 Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: java.lang.RuntimeException: java.lang. reflect.Invoca...

licoolxue的专栏 251

解决org.apache.cxf.wsdl11.WSDLServiceFactory.<init>报NullPointerException

问题描述:最近将一个应用的jar包跟运行的jar打成一个包,以方便部署,不用因为本地改了依赖, 而单个添加新增的jar到部署环境。打包后部署到服务器,jar是起来了,但是访问CXF wsdl服务的时候报NullPointerException。问题原因:打包依赖的maven-shade-plugin没有添加CXF相关的transformer。问题解决:修改pom.xml, 添加CXF wsdl相关...

Extra_warrior的博客 6432

org.apache.cxf.binding.soap.SoapFault: Unexpected wrapper element 出现命名空间不一致问题,解决方法

org.apache.cxf.binding.soap.SoapFault: Unexpected wrapper element 出现命名空间不一致问题,解决方法 @WebService(targetNamespace="http://test.ws.ws.lcp.jh.com/")    不要忘记 http://test.ws.ws.lcp.jh.com/ 结尾的“/”

山峰在前方 8194

cxf动态客户端调用 报错(一)

错误信息: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:76) at org.apache.cxf.endpoint.dyna

xiaoxin5816的博客 4209

exception in thread main org.apache.axis2.wsdl.codegen.CodeGen

我是在 客户端输入 %AXIS2_HOME%\bin\wsdl2java -uri http://localhost:8080/axis2/services/SimpleService?wsdl -p client -s -o stub 生成调用WebService的代码:的时候出错

lm0928524085的专栏 908
上一篇: 【webservice】关于完整的webservice发布系统的开发思路
下一篇: 【webservice】调试方法篇(一、调试工具)
seedingly
博客等级 码龄14年 4粉丝 28原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值