wsimport naming collision

JAXWS 2.0

Java 1.5.0_11

Ant 1.7.0

<wsdl:service name="TempCallback">

<wsdl:port name="TempCallback"

binding="tns:TempSoapBinding">

<soap:address location=" " />

</wsdl:port>

</wsdl:service>

The following error is generated when wsimport is executed on a WSDL containing the above Service element.

error: generator error: java.lang.IllegalArgumentException: trying to create the same field twice: TempCALLBACK

The issue lies in the 揟empCallback?name being used by the port element and service element. I have tried to use an external binding file to change the class name of the service element, but received the same error as before. Any suggestion on how to overcome this naming collision without changing the WSDL directly; any help would be greatly appreciated.

[868 byte] By [qballera] at [2007-11-27 3:46:33]
# 1

I think I have the same problem; here is what I get when I try to generate java classes using wsimport:

[wsimport] command line: wsimport -d C:\workspace\jaxws\bin -keep -s C:\workspace\jaxws\src -verbose C:/workspace/jaxws/descripteurs/WEB-INF/wsdl/JaxServerService.wsdl -p jax1 -b C:\workspace\jaxws\descripteurs\WEB-INF\web.xml

[wsimport] error: java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema

[wsimport] java.lang.IllegalArgumentException: http://www.w3.org/2001/XMLSchema

[wsimport] at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:181)

[wsimport] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:191)

[wsimport] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:67)

[wsimport] at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:126)

[wsimport] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2206)

[wsimport] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:223)

[wsimport] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:180)

[wsimport] at com.sun.tools.ws.processor.config.ModelInfo.buildModel(ModelInfo.java:87)

[wsimport] at com.sun.tools.ws.processor.Processor.runModeler(Processor.java:81)

[wsimport] at com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:543)

[wsimport] at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:56)

[wsimport] at com.sun.tools.ws.ant.WsImport.execute(WsImport.java:419)

[wsimport] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

[wsimport] at org.apache.tools.ant.Task.perform(Task.java:364)

[wsimport] at org.apache.tools.ant.Target.execute(Target.java:341)

[wsimport] at org.apache.tools.ant.Target.performTasks(Target.java:369)

[wsimport] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

[wsimport] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

[wsimport] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

[wsimport] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

[wsimport] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

[wsimport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)

[wsimport] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

BUILD FAILED

C:\workspace\jaxws\build.xml:60: wsimport failed

at com.sun.tools.ws.ant.WsImport.execute(WsImport.java:431)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)

at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Total time: 1 second

Can any one help me?

Best regards

A222a at 2007-7-12 8:50:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Either change the name of the port or the service in the WSDL our use a JAX-WS customization to change the mapping to a different Java name for one of them.
dkohlerta at 2007-7-12 8:50:18 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...