cancel
Showing results for 
Search instead for 
Did you mean: 

Error while generating CXF client code from wsdl

xcoulon
Champ in-the-making
Champ in-the-making
Hello,

[I'm working with Alfresco Community Edition 2.9.0B]
I'm trying to generate a web service client using CXF 2.0.5. The Wsdl2Java tool works fine for 2 of the WSDLs I need (authentication-service and repository-service), but when I try to generate code from content-service.wsdl, I get the following error :

WSDLToJava Error: Element {http://www.alfresco.org/ws/service/content/1.0}content has Having the same name with different types[{http://www.w3.org/2001/XMLSchema}base64Binary – {http://www.alfresco.org/ws/service/content/1.0}Content],  In wrapper style, there is a collision as per the spec.
     [java] org.apache.cxf.tools.common.ToolException: Element {http://www.alfresco.org/ws/service/content/1.0}content has Having the same name with different types[{http://www.w3.org/2001/XMLSchema}base64Binary – {http://www.alfresco.org/ws/service/content/1.0}Content],  In wrapper style, there is a collision as per the spec.
     [java]    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContainer.java:543)
     [java]    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:191)
     [java]    at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:231)
     [java]    at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
     [java]    at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:102)
     [java]    at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:171)

The Ant script I use is :

<project name="cxf wsdl2java" basedir="." default="cxfWSDLToJava">
   <property name="cxf.home" location="D:/apache-cxf-2.0.5-incubator" />

   <path id="cxf.classpath">
      <fileset dir="${cxf.home}/lib">
         <include name="*.jar" />
      </fileset>
   </path>

   <target name="cxfWSDLToJava">
      <delete dir="${basedir}/../java/org/alfresco/ws" failonerror="no" />
      <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true">
         <arg value="-verbose" />
         <arg value="-validate" />
         <arg value="-client" />
         <arg value="-p" />
         <arg value="http://www.alfresco.org/ws/service/content/1.0=org.alfresco.ws.service.content" />
         <arg value="-p" />
         <arg value="http://www.alfresco.org/ws/headers/1.0=org.alfresco.ws.headers" />
         <arg value="-p" />
         <arg value="http://www.alfresco.org/ws/model/content/1.0=org.alfresco.ws.model.content" />
         <arg value="-p" />
         <arg value="http://www.alfresco.org/ws/cml/1.0=org.alfresco.ws.cml" />
         <arg value="-d" />
         <arg value="${basedir}/../java" />
         <arg value="${basedir}/wsdl/content-service.wsdl" />
         <classpath>
            <path refid="cxf.classpath" />
         </classpath>
      </java>
         </target>
    </project>

The code generation works fine when I remove the "write" and "clear" operations, since I just need to read content for now, but yet, this is very annoying.

Any idea ?

Thank you in advance
Xavier
1 REPLY 1

troydf
Champ in-the-making
Champ in-the-making
I have the same problem.

I was thinking it was a cxf error, but I take the newest version (2.0.6) and the error persists.

Thanks!