I am trying to create a web service client in Java. i am following the answer in this question , but i am facing the following errors. and i don't know how to fix them . I tried netBeans but same errors
[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)
here is the link of the WSDL
and this is the first line in 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/"/>
Any help is really appreciable.