webService(cxf)生成客户端报错解决
来源:互联网 发布:高中教学软件 编辑:程序博客网 时间:2024/06/05 05:36
本来准备在eclispe 里面生成的,后来发现 127.0.0.1 和localhost 是生成不了 。后来准备用cmd 生成。
命令:
wsimport -s D:\Users\tao\workspace\cxfDemoClient -p com.client -keep http://127.0.0.1:8008/cxfDemo/ws/demoCXF?wsdl
结果报错:
C:\Users\tao>wsimport -s D:\Users\tao\workspace\cxfDemoClient -p com.client -kee
p http://127.0.0.1:8008/cxfDemo/ws/demoCXF?wsdl
parsing WSDL...
[ERROR] XML 文档结构必须从头至尾包含在同一个实体内。
line 4 of http://127.0.0.1:8008/cxfDemo/ws/demoCXF?wsdl
[ERROR] XML 文档结构必须从头至尾包含在同一个实体内。
Failed to read the WSDL document: http://127.0.0.1:8008/cxfDemo/ws/demoCXF?wsdl,
because 1) could not find the document; /2) the document could not be read; 3)
the root element of the document is not <wsdl:definitions>.
[ERROR] failed.noservice=Could not find wsdl:service in the provided WSDL(s):
At least one WSDL with at least one service definition needs to be provided.
Failed to parse the WSDL.
截图贴上来
我去这是什么情况 ,wsdl 绝对没有问题。那么怎么解决呢?
先在你的浏览器里面将该页面另存为。。。。
我是另存为demoCXF.xml,然后在cmd 窗口切换到存的盘符输入
命令:
C:\Users\tao\Desktop>wsimport -s D:\Users\tao\workspace\cxfDemoClient -p com.client -keep demoCXF.xml
好了搞定了。
命令注解:
D:\Users\tao\workspace\cxfDemoClient >>>>>eclipse工作空间的项目目录
-d <directory> 指定输出目录
-b <path> 指定JAXWS或者JAXB的绑定文件,可以多个
-B <jaxbOption> 指定JAXB的参数,透传给JAXB命令
-catalog 绑定外部WSDL或XSD,解决外部WSDL或者XSD引用
-extension Allow vendor extensions (functionality not specified by the specification). Use of extensions may result in applications that are not portable or may not interoperate with other implementations.
-help 显示帮助
-httpproxy:<host>:<port> 指定一个HTTP代理
-keep 保留源文件
-p <pkg> 指定包名
-s <directory> 指定源代码存放目录
-encoding <encoding> 指定编码格式,例如UTF-8
-verbose 指定输出命令执行的详细信息
-version 显示版本
-fullversion 显示详细的版本信息
-clientjar <jarfile> Creates the jar file of the generated artifacts along with the WSDL metadata required for invoking the web service.
-wsdllocation <location> @WebServiceClient.wsdlLocation value.
-target <version> 指定JAX-WS的版本,默认是 2.2.
-quiet 静默执行该命令,不在屏幕输出信息
-XadditionalHeaders Map the headers not bound to request or response message to Java method parameters.
-Xauthfile File to carry authorization information in the format http://username:password@example.org/stock?wsdl. Default value is $HOME/.metro/auth
-Xdebug 显示DEBUG信息
-XdisableAuthenticator Disables Authenticator used by JAX-WS RI, -Xauthfile option will be ignored if -XdisableAuthenticatoris set.
-Xno-addressing-databinding 不使用JDK的Addressing,生成自己的EndpointReferenceType
-Xnocompile 不编译生成的源码
-XdisableSSLHostnameVerification Disbales the SSL Hostname verification while fetching the wsdls.
参考资料
http://mhsjlove.iteye.com/blog/1838339
- webService(cxf)生成客户端报错解决
- CXF 生成客户端报错
- CXF 生成客户端报错。
- cxf生成webservice客户端
- CXF生成webservice客户端
- webservice CXF 客户端调用报错
- CXF客户端调用webservice接口报错
- 用apache-cxf生成webservice客户端的时候报错Parameter: shead already exists for method
- 用apache-cxf生成webservice客户端的时候报错Parameter: shead already exists for method
- 使用cxf生成webservice客户端调用异常解决
- CXF自动生成客户端报错
- cxf生成webservice客户端代码
- webService-cxf方式生成客户端
- 使用CXF生成webService客户端
- cxf生成java客户端 webservice
- CXF生成webservice动态客户端
- CXF webservice报错
- WebService之CXF(二、客户端的生成与调用)
- 关于微信 调用js-sdk接口报错的问题
- margin-top、padding-top的值是百分比该如何计算
- 初学Android之viewPager+imageLoader+图片圆角(类似qq头像)+xListView+DrawLayout
- 推荐一个 linux资料大全的 linux技术导航站
- MySQL免安装版安装步骤
- webService(cxf)生成客户端报错解决
- Java打包文件夹以及子文件夹为zip包
- 百度创始人----李彦宏
- Java笔记(一):接口、静态变量、重写重载、获得新线程、常见异常、枚举、字节流字符流
- Android中手机的网络状态(判断是否联网/3G/4G/WIFI)
- [codevs4888零件分组][codevs1044拦截导弹]
- 1027. 打印沙漏(20)
- 常用vim指令
- <搬运>HTML参考手册