Skip to main content

Create a java client from wsdl (wcf service)

2 replies [Last post]
gauxrox
Offline
Joined: 2010-07-20
Points: 0

Hi all,

I'm trying to create a standalone client (JAVA SE) from the following wsdl
http://homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/Moebius...

What toll I have to use?

I've used the following:
- apache-cxf-2.7.0 (wsdl2java)
- axis2 Code Generator plugin for eclipse
- axis2 (wsdl2java)
- jaxws-ri (wsimport)
- metro (wsimport)
- NetBeans IDE Dev (Build nbms-and-javadoc-9529-on-20121106)

In netbeans, the error that appears is:

ant -f C:\\root7\\code\\NetBeans\\WebApplication3 wsimport-service-clean-NewWebServiceFromWSDL3 wsimport-service-generate
wsimport-service-clean-NewWebServiceFromWSDL3:
Deleting directory C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\service\NewWebServiceFromWSDL3
init:
wsimport-init:
wsimport-service-NewWebServiceFromWSDL3:
Created dir: C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\service\NewWebServiceFromWSDL3
command line: wsimport -d C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\service\NewWebServiceFromWSDL3 -extension -Xnocompile -Xendorsed -keep -s C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\service\NewWebServiceFromWSDL3 -encoding UTF-8 -catalog C:\root7\code\NetBeans\WebApplication3\catalog.xml -verbose C:\root7\code\NetBeans\WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.wsdl
parsing WSDL...


[ERROR] A class/interface with the same name "org.datacontract.schemas._2004._07.ssi_core.PersistentObjectOfString" is already in use. Use a class customization to resolve this conflict.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] (Relevant to above error) another "PersistentObjectOfstring" is generated from here.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] This error is caused because on Windows you cannot have both "PersistentObjectOfstring.java" and "PersistentObjectOfString.java" in the same directory.


[ERROR] A class/interface with the same name "org.datacontract.schemas._2004._07.ssi_core.PersistentObjectOfInt" is already in use. Use a class customization to resolve this conflict.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] (Relevant to above error) another "PersistentObjectOfint" is generated from here.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] This error is caused because on Windows you cannot have both "PersistentObjectOfint.java" and "PersistentObjectOfInt.java" in the same directory.


[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] (Related to above error) This is the other declaration.  
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] Two declarations cause a collision in the ObjectFactory class.
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] (Related to above error) This is the other declaration.  
  line 1 of file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

C:\root7\code\NetBeans\WebApplication3\nbproject\jaxws-build.xml:33: Error starting wsimport:
BUILD FAILED (total time: 1 second)

I need to use the "external binding files"?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmazza
Offline
Joined: 2005-01-14
Points: 0

I hope you aren't using all those tools at once. I'd recommend using Maven with either Metro *or* Apache CXF, here's my tutorial: http://www.jroller.com/gmazza/entry/soap_client_tutorial. If you use Apache CXF, use that project's mailing list instead (I'm on that one too.)

Glen

Anonymous

Hi all,

I'm trying to create a standalone client (JAVA SE) from the following
wsdl
http://homologamoebius.sondaprocwork.com.br/V5/IntegracaoMoebius/Moebiu
s...

What toll I have to use?

I've used the following:
- apache-cxf-2.7.0 (wsdl2java)
- axis2 Code Generator plugin for eclipse
- axis2 (wsdl2java)
- jaxws-ri (wsimport)
- metro (wsimport)
- NetBeans IDE Dev (Build nbms-and-javadoc-9529-on-20121106)

In netbeans, the error that appears is:

ant -f C:\\root7\\code\\NetBeans\\WebApplication3
wsimport-service-clean-NewWebServiceFromWSDL3 wsimport-service-generate
wsimport-service-clean-NewWebServiceFromWSDL3:
Deleting directory
C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\serv
ice\NewWebServiceFromWSDL3
init:
wsimport-init:
wsimport-service-NewWebServiceFromWSDL3:
Created dir:
C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\serv
ice\NewWebServiceFromWSDL3
command line: wsimport -d
C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\serv
ice\NewWebServiceFromWSDL3 -extension -Xnocompile -Xendorsed -keep -s
C:\root7\code\NetBeans\WebApplication3\build\generated\jax-wsCache\serv
ice\NewWebServiceFromWSDL3 -encoding UTF-8 -catalog
C:\root7\code\NetBeans\WebApplication3\catalog.xml -verbose
C:\root7\code\NetBeans\WebApplication3/src/conf/xml-resources/web-servi
ces/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com.br/V5
/IntegracaoMoebius/MoebiusIntegration.svc.wsdl
parsing WSDL...

[ERROR] A class/interface with the same name
"org.datacontract.schemas._2004._07.ssi_core.PersistentObjectOfString"
is already in use. Use a class customization to resolve this conflict.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] (Relevant to above error) another "PersistentObjectOfstring" is
generated from here.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] This error is caused because on Windows you cannot have both
"PersistentObjectOfstring.java" and "PersistentObjectOfString.java" in
the same directory.

[ERROR] A class/interface with the same name
"org.datacontract.schemas._2004._07.ssi_core.PersistentObjectOfInt" is
already in use. Use a class customization to resolve this conflict.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] (Relevant to above error) another "PersistentObjectOfint" is
generated from here.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd5.xsd

[ERROR] This error is caused because on Windows you cannot have both
"PersistentObjectOfint.java" and "PersistentObjectOfInt.java" in the
same directory.

[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] (Related to above error) This is the other declaration.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] Two declarations cause a collision in the ObjectFactory class.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

[ERROR] (Related to above error) This is the other declaration.
line 1 of
file:/C:/root7/code/NetBeans/WebApplication3/src/conf/xml-resources/web
-services/NewWebServiceFromWSDL3/wsdl/homologamoebius.sondaprocwork.com
.br/V5/IntegracaoMoebius/MoebiusIntegration.svc.xsd_xsd3.xsd

C:\root7\code\NetBeans\WebApplication3\nbproject\jaxws-build.xml:33:
Error starting wsimport:
BUILD FAILED (total time: 1 second)

I need to use the "external binding files"?