axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Georg Hicker <georg.hic...@reflex.at>
Subject AXIS 1.3: Java2WSDL incorrect creation
Date Fri, 28 Apr 2006 12:54:41 GMT
Hello everybody!

I'm currently working on a problem concerning Java2WSDL (axis v. 1.3) 
and am not quite sure if I am using the task correctly.

I want to create a WSDL-file which contains the spec for a service of 
mine. My webservice should return a CoordinationContextType which is 
defined in the namespace "http://schemas.xmlsoap.org/ws/2004/10/wscoor" 
(see attached wscoor.xsd). If I run Java2WSDL as specified below, I get 
a wsdl-file that is corrupted in that way, that it 1. redefines the 
CoordinationContextType in an own schema within the wsdl and 2. the 
definition is not correct, because it contains a simplecontent element 
with an extension child without a base specified.

Here is the command i use to run the example:
|java -cp 
"%AXISCLASSPATH%;.;..\..\java\;..\..\..\target\classes;C:\Dokumente und 
Einstellungen\your 
servant\.maven\repository\addressing\jars\addressing-SNAPSHOT.jar" 
org.apache.axis.wsdl.Java2WSDL -o BaSuite.wsdl 
-lhttp://localhost:8081/axis/services/BaSuite -AOPERATION 
-nurn:ba.test.kandula.apache.org -Nurn:impl -yDOCUMENT 
-phttp://schemas.xmlsoap.org/ws/2004/10/wscoor=org.apache.kandula.wscoor 
-xhttp://schemas.xmlsoap.org/ws/2004/08/addressing 
org.apache.kandula.test.ba.BaSuitePortType
|
The Output on the commandline is:
|java.lang.NoClassDefFoundError: 
org/apache/axis/message/addressing/EndpointReferenceType
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at org.apache.axis.wsdl.fromJava.Types.isEnumClass(Types.java:1125)
        at 
org.apache.axis.wsdl.fromJava.Types.makeTypeElement(Types.java:1828)
        at 
org.apache.axis.wsdl.fromJava.Types.writeTypeForPart(Types.java:421)
        at 
org.apache.axis.wsdl.fromJava.Emitter.writePartToMessage(Emitter.java:1909)
        at 
org.apache.axis.wsdl.fromJava.Emitter.writeResponseMessage(Emitter.java:1752)
        at 
org.apache.axis.wsdl.fromJava.Emitter.writeMessages(Emitter.java:1121)
        at 
org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:1075)
        at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:484)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:331)
        at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:430)
        at org.apache.axis.wsdl.Java2WSDL.run(Java2WSDL.java:588)
        at org.apache.axis.wsdl.Java2WSDL.main(Java2WSDL.java:682)

|Although I'm quite sure that this file is in the classpath.
In Eclipse I ran the same command as ant-task:
|    <target name="java2wsdl" depends="compilePT" description="Creates 
the Stubs for the WSDL">
        <java classname="org.apache.axis.wsdl.Java2WSDL" fork="true">
            <arg value="-o"/>
            <arg value= "BaSuite.wsdl"/>
            <arg value="-l"/>
            <arg value="http://localhost:8081/axis/services/BaSuite"/>
            <arg value="-A"/>
            <arg value="OPERATION"/>
            <arg value="-n"/>
            <arg value="urn:ba.test.kandula.apache.org"/>
            <arg value="-N"/>
            <arg value="urn:impl"/>
            <arg value="-y"/>
            <arg value="DOCUMENT"/>
            <arg 
value="-phttp://schemas.xmlsoap.org/ws/2004/10/wscoor=org.apache.kandula.wscoor"/>
            <arg 
value="-xhttp://schemas.xmlsoap.org/ws/2004/08/addressing"/>
            <arg value="org.apache.kandula.test.ba.BaSuitePortType"/>
      <classpath>
            <pathelement location="${basedir}"/>
            <pathelement location="${home.dir}"/>
          <path refid="base.classpath" />
      </classpath>
    </java>
    </target>
|
Here I get:
     [java] 28.04.2006 14:38:55 org.apache.axis.wsdl.fromJava.Emitter 
writePartToMessage
     [java] WARNUNG: Please register a typemapping/beanmapping for 
'org.apache.kandula.wscoor.CoordinationContextType'
     [java] 28.04.2006 14:38:55 org.apache.axis.wsdl.fromJava.Types 
isBeanCompatible
     [java] WARNUNG: The class 
org.apache.axis.message.addressing.AttributedQName does not contain a 
default constructor, which is a requirement for a bean class.  The class 
cannot be converted into an xml schema type.  An xml schema anyType will 
be used to define this class in the wsdl file.
     [java] 28.04.2006 14:38:55 org.apache.axis.wsdl.fromJava.Types 
isBeanCompatible
     [java] WARNUNG: The class 
org.apache.axis.message.addressing.ServiceNameType does not contain a 
default constructor, which is a requirement for a bean class.  The class 
cannot be converted into an xml schema type.  An xml schema anyType will 
be used to define this class in the wsdl file.

If i specify to import the xsd-files for wscoor and adressing the 
problem doesn't get better: Then I get a wsdl-file with these two 
schemata but nonetheless a new schema is defined for the 
CoordinationContextType and its content.

Attached you can see everything I have done so far:
BaSuitePortType.java         - the Interface I want to create a service for.
build.xml                             - the ant-definition I have created
doJava2WSDL.bat             - same as the ant-task, but for the commandline
addr.xsd                             - The ws-addressing schema (located 
in subfolder schema)
wscoor.xsd                         - the ws-coordination schema (located 
in subfolder schema)
BaSuite.wsdl                       - example for the outcome I get


I hope somebody could perhaps help me.

thanks,
kind regards
georg

Mime
View raw message