当前位置: 首页 > 知识库问答 >
问题:

wsimport在分析WSDL时出现问题

潘国源
2023-03-14

我正试图通过使用wsimport从此处https://gpcs.3m.com/gpcs/claimprocessingservice?WSDL解析WSDL文件来生成java客户机,但不起作用。
我在Windows中使用JDK8。具体情况如下。我正在使用一个JVM参数来解决类似JDK8的WebService客户端生成错误的问题

C:\workspace\client\src>wsimport -J-Djavax.xml.accessExternalSchema=all -keep https://gpcs.3m.com/Gpcs/ClaimProcessingService?wsdl

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1899 of https://gpcs.3m.com/Gpcs/ClaimProcessingService?xsd=gpcs_standard_2016_3_0.xsd
[ERROR] (Related to above error) This is the other declaration.
  line 1899 of https://gpcs.3m.com/Gpcs/ClaimProcessingService?xsd=gpcs_standard_2016_3_1.xsd

Exception in thread "main" com.sun.tools.internal.ws.wscompile.AbortException
        at com.sun.tools.internal.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:129)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2283)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:183)
        at com.sun.tools.internal.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:429)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:190)
        at com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
        at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)

我还在本地下载了WSDL文件,并通过删除一些引用对其进行了修改,因为错误太多,无法看到。当我这样做时,我可以看到下面显示的错误消息的开头

    [ERROR] A class/interface with the same name "com._3m.gpcs.standard._2016_0.ClaimErrorType" is already in use. Use a class customization to resolve this conflict.
      line 3409 of https://gpcs.3m.com/Gpcs/ClaimProcessingService?xsd=gpcs_standard_2016_0_0.xsd
    [ERROR] (Relevant to above error) another "ClaimErrorType" is generated from here.
      line 3411 of https://gpcs.3m.com/Gpcs/ClaimProcessingService?xsd=gpcs_standard_2016_0_1.xsd
    [ERROR] A class/interface with the same name "com._3m.gpcs.standard._2016_0.ErrorSeverity" is a

lready in use. Use a class customization to resolve this conflict.
  line 3473 of https://gpcs.3m.com/Gpcs/ClaimProcessingService?xsd=gpcs_standard_2016_0_0.xsd

有人知道为什么这不能生成java代码吗?我还尝试使用Eclipse创建java客户机,但同样失败,出现以下错误。提前道谢。

IWAB0399E Error in generating Java from WSDL:  java.io.IOException: WSDL2Java emitter timed out (this often means the WSDL at the specified URL is inaccessible)!
    java.io.IOException: WSDL2Java emitter timed out (this often means the WSDL at the specified URL is inaccessible)!
    at org.apache.axis.wsdl.gen.Parser.run(Parser.java:320)
    at org.apache.axis.wsdl.toJava.Emitter.run(Emitter.java:599)
    at org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand.execute(WSDL2JavaCommand.java:207)
    at org.eclipse.jst.ws.internal.axis.consumption.ui.task.ClientCodeGenOperation$ClientWSModifyOperation.execute(ClientCodeGenOperation.java:144)
    at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:108)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
    at org.eclipse.ui.actions.WorkspaceModifyOperation.run

共有1个答案

沈琨
2023-03-14

我得到它来生成客户端。WSDL包含所有系统版本的版本。在WSDL URL中传递version参数将为您提供一个特定的版本。显然,我在阅读他们的文档时错过了这一点。

我尝试传递一个JVM参数-b-xautonameresolution(这里提到过),如何使用类定制来解决文件生成冲突,但没有成功。我找到了一个在线的WSDL验证网站,并注意到它缺少了太多的XSD引用,而这些引用都是System的可用版本。这使我意识到我只需要下载特定版本的WSDL。

 类似资料:
  • 我一直在探索StackOverflow、Medium和一些Google,但还没有找到解决方案。 我目前正在使用弹出的Expo应用程序。我需要将compileSdkVersion和targetSdkVersion升级到31,因为对讲机当前需要它。 虽然其他一切都保持不变,但一旦我将和更改为上述值并下载编译后的. apk我在S10e(Android 12)中遇到 我尝试在Android 9模拟器上运行

  • 我很抱歉,如果这是一个重复的问题--我找了一个文件,发现了很多类似的问题,但没有什么是完全相同的。 [错误]文件提前结束。http://api.dss.gov.au/dataCollection/dex的第1行?wsdl&type=xsd&file=文件%3a%2fc%3a%2ftfs%2fccsapps%2fdataCollection%2f分支%2fmr17.11%2fosb%2fdataCo

  • 问题内容: 我正在用Python阅读JSON文件,其中包含许多字段和值(约8000条记录)。Env:Windows 10,Python 3.6.4;码: 这样我得到一个错误。下面是堆栈跟踪: 伴随着我,我尝试了 与此相关,我的程序运行了很长时间,然后挂起,没有任何输出。 我搜索了几乎与此相关的所有主题,但找不到解决方案。 注意:JSON数据是有效的,因为当我在Postman /任何REST客户端上

  • 问题内容: 我正在尝试使用JDK 6工具为某些SOAP Web服务生成客户端。WSDL由.NET 2.0应用程序生成。对于.NET 3.X应用程序,它可以正常工作。 当我跑步 它显示了一些错误消息,如下所示: [错误]具有相同名称“ mypackage.SomeClass”的类/接口已在使用中。使用类自定义解决此冲突。行?? 的HTTP://为MyService WSDL 当我使用Axis 1.4

  • 我的ThymileAF模板中有一个AngularJS属性,看起来像这样: 当Thymeleaf尝试处理此模板时,我得到以下异常: Thymeleaf只是不能很好地处理

  • 问题内容: 在PostgreSQL中,我有一个名为的表。 如您所见,列为。 在Go中,我想通过请求在该表中创建新条目。我像这样发送JSON对象: 不幸的是,它引发了奇怪的 错误 : 我在哪里犯错误以及如何解决我的问题? models / surveys.go: 控制器/surveys.go: 问题答案: 该错误已说明出了什么问题: 将时间“” 2019-01-01 00:00:00“”解析为“”