java | Web 服务 WSDL 验证错误

标签 java eclipse web-services myeclipse

我已经使用 java 5 和 tomcat 5.0 在 myecplise 上成功构建并部署了 jax-ws Web 服务,但是当我尝试创建 Web 服务客户端时,我在验证屏幕上收到验证错误

WS-I: A problem occurred while running the WS-I WSDL conformance check: org.eclipse.wst.wsi.internal.analyzer.WSIAnalyzerException. The WS-I Test Assertion Document(TAD) was not found or could not be processed. The WSDLAnalyzer was not able to validate the given WSDL file.

即使我忽略 myecplise 也不允许我创建客户端的情况。

忽略屏幕#01

src-resolve: Cannot resolve the name
'impl:Arrayof_tns1_MatchingDoc' to a(n) 'type definition' component

忽略屏幕#02

src-resolve: Cannot resolve the name 
'soapenc:Array' to a(n) 'type definition component

忽略这两个屏幕后,它给了我一个错误

undefined simple or complex type 'soapenc:Array'

并存在向导...

最佳答案

如果您尝试编译由 Axis1 生成的RPC 编码 Web 服务的 WSDL,则可能会出现提及 soapenc:Array 的错误。至少对我来说是这样。
这确实很痛苦,因为无法使用 wsconsume 甚至使用与 Axis2 发行版或 xfire 捆绑在一起的 wsdl2java 来编译此 WSDL

我最终下载了1.4 release ofAxis1并使用捆绑的 WSDL2java。您必须从 axis.jar 内部将其调用为 org.apache.axis.wsdl.WSDL2Java。恕我直言,最舒服的方法是使用运行配置中的参数从 eclipse 运行 .jar。

不幸的是,这并不是故事的结尾,因为生成的类有可能会出现您必须手动修复的错误(例如重复方法等)。因此,将 WSDL2java 任务集成到 ant 构建中时要小心。

关于 java | Web 服务 WSDL 验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3349858/

相关文章:

eclipse - 在 Mac 上为 PostgreSQL 安装 PDO 驱动程序(使用 Zend for eclipse)

php - 我是否需要编写代码来对来自 iOS 应用程序的服务器请求进行排队?

java - 如何创建 Battleship 战舰游戏算法

java - 在 Eclipse 中内部化字符串

java - ImageView 未显示在三星 One UI 设备的显示剪切区域中

android - 无法初始化 Crashlytics,AndroidManifest.xml 中缺少 API key

java.lang.LinkageError : loader constraint violation in interface itable initialization: when resolving method

java - 如何将 XML 转换为 MessageElement[] Java

java - Web 容器究竟何时初始化 servlet?

java - JDBC 查询不返回行,但交互式查询返回行?