WebService客户端生成代码错误解决方案
来源:互联网 发布:下载中国网络电视台直播 编辑:程序博客网 时间:2024/06/05 16:07
1.在浏览器中打开webservice url,保存wsdl文件,如ContentService.xml
2.通过cxf命令“wsdl2java –d E:/file –frontend jaxws21 –client C:\ ContentService.xml”生成客户端代码
3.若报WSDLToJava Error: Thrown by JAXB : undefined simple or complex type 'soap-enc:Array' ,
则需要在生成的文件中找到
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />,
在浏览器中打开http://schemas.xmlsoap.org/soap/encoding/,
保存文件soap-encoding.xsd,
然后修改成<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="soap-encoding.xsd"/>,
2.通过cxf命令“wsdl2java –d E:/file –frontend jaxws21 –client C:\ ContentService.xml”生成客户端代码
3.若报WSDLToJava Error: Thrown by JAXB : undefined simple or complex type 'soap-enc:Array' ,
则需要在生成的文件中找到
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />,
在浏览器中打开http://schemas.xmlsoap.org/soap/encoding/,
保存文件soap-encoding.xsd,
然后修改成<import namespace="http://schemas.xmlsoap.org/soap/encoding/" schemaLocation="soap-encoding.xsd"/>,
再运行上面的命令即可。
4.如果需要NTLM认证,则需在代码中加入如下的代码:
- Client client = ClientProxy.getClient(port);
- HTTPConduit http = (HTTPConduit) client.getConduit();
- HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
- httpClientPolicy.setConnectionTimeout(36000);
- httpClientPolicy.setAllowChunking(false);
- http.setClient(httpClientPolicy);
- http.getAuthorization().setAuthorizationType("NTLM");
- http.getAuthorization().setUserName("xxxx");
- http.getAuthorization().setPassword("xxxxx");
1 0
- WebService客户端生成代码错误解决方案
- webservice 生成客户端代码
- WebService生成客户端代码
- Webservice 之生成客户端代码
- cxf生成webservice客户端代码
- jdk生成webservice客户端代码
- soapUI生成WebService客户端代码
- webservice命令行生成客户端代码
- webservice wsdl2Java 生成客户端代码
- webservice 自动生成客户端代码
- 【webservice】生成axis1的webservice客户端代码
- 【webservice】生成axis2的webservice客户端代码
- webService学习3:客户端生成webservice代码
- 用WSAD工具生成WebService客户端代码
- Eclipse插件生成webservice客户端调用代码
- 利用Myeclipse自动生成webService客户端代码
- 利用Myeclipse自动生成webService客户端代码
- 利用WSDL2java 生成cxf webservice 客户端代码
- 7个示例科普CPU Cache
- Linux常用命令
- 转载:性能调优攻略
- 洛谷 P3112 [USACO14DEC] 后卫马克Guard Mark
- 一种自动反射消息类型的 Google Protobuf 网络传输方案
- WebService客户端生成代码错误解决方案
- 文章标题
- dede标签:arclist标签使用大全
- lintcode(115)不同的路径2
- Apache+PHP+MySql -- 常用配置地址
- 【技能库】--完整的RPC框架示例(143)
- 矩阵n*m找出最大值的行列号及值
- Linux常用配置命令
- bzoj 3238: [Ahoi2013]差异 后缀树