-
1. Re: Web service client in EJB 3.x - best practice
pi4630 Aug 31, 2011 4:14 AM (in response to pi4630)After several unsuccessful attempts to get the webservice client stub and proxies done with wsconsume for this apparently particular WSDL (it points to a xsd of another namespace and wsconsume would throw a java.net.Connection error when trying to access that definition), I was able to generate the client classes using Axis 1.4 and using them by copying the necessary Axis jars into %JBOSS%/server/default/lib directory.
-
2. Re: Web service client in EJB 3.x - best practice
mmusaji Sep 2, 2011 8:43 AM (in response to pi4630)From you original post, what you described should work. Could you upload the WSDL you tried to generate the client stubs from and I'll try and have a look if I get a chance. Also, how was this WSDL generated?
-
3. Re: Web service client in EJB 3.x - best practice
pi4630 Sep 6, 2011 7:19 AM (in response to mmusaji)This is the WSDL:
http://cooperazione.sian.it/wspdd/services/AllineamentoGIS?wsdl
-
4. Re: Web service client in EJB 3.x - best practice
mmusaji Sep 6, 2011 7:51 AM (in response to pi4630)1 of 1 people found this helpfulSo I tried using wsconsume.sh directly from a JBoss + CXF and got the following stack
org.apache.cxf.tools.common.ToolException: Thrown by JAXB : Two declarations cause a collision in the ObjectFactory class.
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error(JAXBBindErrorListener.java:41)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:286)
at com.sun.tools.xjc.util.ErrorReceiverFilter.error(ErrorReceiverFilter.java:77)
at com.sun.tools.xjc.ErrorReceiver.error(ErrorReceiver.java:82)
at com.sun.tools.xjc.generator.bean.ObjectFactoryGeneratorImpl.populate(ObjectFactoryGeneratorImpl.java:187)
at com.sun.tools.xjc.generator.bean.PublicObjectFactoryGenerator.populate(PublicObjectFactoryGenerator.java:55)
at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:242)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:175)
at com.sun.tools.xjc.model.Model.generateCode(Model.java:286)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:252)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
at org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:374)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:576)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:228)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:128)
at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:271)
at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
at org.jboss.wsf.stack.cxf.tools.CXFConsumerImpl.consume(CXFConsumerImpl.java:224)
at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:230)
at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:81)
Caused by: com.sun.istack.SAXParseException2: Two declarations cause a collision in the ObjectFactory clas
It looks like the WSDL has two declarations either within a schema import or the WSDL itself that clash. Axis may ignore this which is why it's not exactly the best because this can lead to issues later when developing client side code. You can try and use databinding to rename any clashes but you need to know what they are first.
-
5. Re: Web service client in EJB 3.x - best practice
pi4630 Sep 6, 2011 7:53 AM (in response to mmusaji)Yes, I imagined... but the guys behind that WSDL wouldn't care.
I'll make my tests with the Axis 1.4 generated client and stubs, if that works, I'll let it be.
Thanks for caring!
~pasquale