从WSDL生成JAX-WS工件时发生冲突错误

时间:2015-07-13 23:09:53

标签: java web-services soap wsdl

我正在尝试用Java创建一个Web服务客户端。我正在关注question中的答案,但我面临以下错误。我不知道如何解决它们。我尝试过netBeans但错误相同

 [ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of http://41.137.246.222/Service.svc?xsd=xsd3

[ERROR] (Related to above error) This is the other declaration.
  line 1 of http://41.137.246.222/Service.svc?xsd=xsd3

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:497)
    at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:159)
    at com.sun.tools.internal.ws.WsImport.main(WsImport.java:42)

这是WSDL

的链接

这是xsd3

中的第一行
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/SABil.DataObjects" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/SABil.DataObjects">
<xs:import schemaLocation="http://41.137.246.222/Service.svc?xsd=xsd4" namespace="http://schemas.datacontract.org/2004/07/"/> 

任何帮助都非常明显。

0 个答案:

没有答案