Web service client cannot be created by JAXWS:wsimport utility

mgk22 picture mgk22 · Jan 2, 2014 · Viewed 11.2k times · Source

Whenever i try to create a Webservice from a wsdl url i get an Error window in Netbeans IDE. Where there is no package or reference like this.

enter image description here

Here is my stack trace.

parsing WSDL...

[ERROR] A class/interface with the same name "org.wi.link.action.Exception" is already in use. Use a class customization to resolve this conflict. line 35 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

[ERROR] (Relevant to above error) another "Exception" is generated from here. line 30 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

[ERROR] Two declarations cause a collision in the ObjectFactory class. line 35 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

[ERROR] (Related to above error) This is the other declaration.
line 30 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

[ERROR] Two declarations cause a collision in the ObjectFactory class. line 38 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

[ERROR] (Related to above error) This is the other declaration.
line 32 of file:/D:/Development/source/WebServiceProject/TestProject/src/conf/xml-resources/web-service-references/service/wsdl/urladdress/wionline/services/service.wsdl

D:\Development\source\WebServiceProject\TestProject\nbproject\jaxws-build.xml:225: wsimport failed BUILD FAILED (total time: 2 seconds)

I can also post jaxws-build.xml if required Thanks in advance.

Answer

Bhumika picture Bhumika · Jun 4, 2015

Webservice cannot be created with wsdl , only webservice client(to consume WS) can be created using wsdl.

For me the problem solved , by mistake i was adding "Web Service Client" with incorrect wsdl url , i was adding http://localhost:8080/MyService/MyService?Tester, which is the ws tester url.

The correct url should be the WSDL url i.e. http://localhost:8080/MyService/MyService?WSDL

Steps followed: 1. Go to Project-war 2. Right Click New > WebService Client 3. Select WSDL URL, paste the WSDL url , give package name

And its done :)

For me the problem solved .

You can only create WS from scratch or from existing bean.

Hope this will help you.