Hi Robert,
Did you manage to get this fixed. I just ran the wsdl2java on the wsdl
and it ran fine. If its still failing try to check the wsdl4j version.
I use to have some problems with pre rc2 versions of wsdl.
Thanks
Chathura

On 3/6/06, robert <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm running the latest svn and I'm getting this error:
>
> wsdl2java:
>      [java] Exception in thread "main" java.lang.ClassCastException:
> org.apache.wsdl.extensions.impl.SchemaImpl
>      [java]     at
> org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.copyExtensibleElements(WSDLPump.java:1233)
>      [java]     at
> org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.populateDefinition(WSDLPump.java:182)
>      [java]     at
> org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.pump(WSDLPump.java:136)
>      [java]     at
> org.apache.axis2.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder.build(WSDL1ToWOMBuilder.java:124)
>      [java]     at
> org.apache.axis2.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder.build(WSDL1ToWOMBuilder.java:93)
>      [java]     at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getWOM(CodeGenerationEngine.java:162)
>      [java]     at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:70)
>      [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>      [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
>
> My simple test case wsdl is:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <definitions name="SimpleService" targetNamespace="http://simpleNS";
> xmlns:tns="http://simpleNS"; xmlns="http://schemas.xmlsoap.org/wsdl/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:ns2="http://simpleNS/types";>
>   <types>
>     <schema targetNamespace="http://simpleNS/types";
> xmlns:tns="http://simpleNS/types";
> xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns="http://www.w3.org/2001/XMLSchema";>
>       <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>       <element name="simpleLogin">
>         <complexType>
>           <sequence>
>             <element name="user_name" type="xsd:string"/>
>             <element name="user_password" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="simpleLoginResponse">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
> </schema></types>
>   <message name="SimpleEndpoint_simpleLogin">
>      <part name="parameters" element="ns2:simpleLogin"/>
>   </message>
>   <message name="SimpleEndpoint_simpleLoginResponse">
>     <part name="result" element="ns2:simpleLoginResponse"/>
>   </message>
>   <portType name="SimpleEndpoint">
>     <operation name="simpleLogin">
>       <input message="tns:SimpleEndpoint_simpleLogin"
> name="SimpleEndpoint_simpleLogin"/>
>       <output message="tns:SimpleEndpoint_simpleLoginResponse"
> name="SimpleEndpoint_simpleLoginResponse"/>
>     </operation>
>   </portType>
>   <binding name="SimpleEndpointBinding" type="tns:SimpleEndpoint">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http";
> style="document"/>
>     <operation name="simpleLogin">
>       <soap:operation soapAction="simpleLogin"/>
>       <input name="SimpleEndpoint_simpleLogin">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SimpleEndpoint_simpleLoginResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>   </binding>
>   <service name="SimpleService">
>     <port name="SimpleEndpointPort" binding="tns:SimpleEndpointBinding">
>       <soap:address
> location="http://localhost:8080/axis2/services/SimpleEndpoint"/></port></service></definitions>
>
> My ant task is:
>
>  <target name="wsdl2java" depends="clean,prepare">
>       <delete dir="output" />
>       <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
>           <classpath refid="axis.classpath"/>
>           <arg value="-d"/>
>           <arg value="xmlbeans"/>
>           <arg value="-uri"/>
>           <arg file="wsdl/simple.wsdl"/>
>           <arg value="-ss"/>
>           <arg value="-sd"/>
>           <arg value="-g"/>
>           <arg value="-o"/>
>           <arg file="output"/>
>           <arg value="-p"/>
>           <arg value="org.simple.endpoint"/>
>       </java>
>
>       <!-- Move the schema folder to classpath-->
>       <move todir="build/classes">
>           <fileset dir="output">
>               <include name="**/*schema*/**/*.class"/>
>               <include name="**/*schema*/**/*.xsb"/>
>           </fileset>
>       </move>
>
>   </target>
>
> The ant task completes using .94 . Any ideas?
>
> Robert
> http://www.braziloutsource.com/
>


--
Chathura Herath
http://people.apache.org/~chathura/
http://chathurah.blogspot.com/

Reply via email to