Search code examples
javaweb-servicesstruts2wsdljax-ws

Developing JAX-WS Web Service Clients runs into error


I am following Netbean's tutorial and eclipse tutorial to generate code from this wsdl but in netbeans it runs into following error

"Two declarations cause a collision in the ObjectFactory class". 

In Eclipse it runs into following error.

"WAB0399E Error in generating Java from WSDL:  java.io.IOException: Emitter failure.  There is an undefined portType (I3Service) in the WSDL document http://i3-cert.vueling.com/Vueling.I3.WCF.WebService/I3Service.svc?wsdl=wsdl0.
Hint: make sure <binding type=".."> is fully qualified."

What should I do?


Solution

  • JAX-WS uses JAXB to generate artifacts from a WSDL, if you have two or more types defined in your schema with the same name JAXB can not generate an artifact for that type twice (collision) in the same package. You may resolve the problem with a JAXB bindings file, by this way JAXB can generate the artifacts into different packages for duplicate types but requires time to detect that types and some detailed configuration. Check the Oracle wsimport tool and try to get the artifacts for the WSDL with - verbose option to trace and get the conflicting types, look at http://docs.oracle.com/javase/7/docs/technotes/tools/share/wsimport.html, wsimport is available for javase 6 too. That WSDL is not well defined, try to parse it with some validation tool like xmlspy or simillar and check results.