axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ephemeris Lappis (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1734) JAVA2WSDL (ant) with document/literal encoding
Date Tue, 21 Dec 2004 08:58:22 GMT
     [ http://nagoya.apache.org/jira/browse/AXIS-1734?page=comments#action_56928 ]
     
Ephemeris Lappis commented on AXIS-1734:
----------------------------------------

Looking at the 1.2 RC2 delivery documentation, the java2wsdl task is expected to support a
nested classpath element... It seems a good thing, since the same taskdef can be used to generate
several files from different sources in different classpaths...

And, for sure, it actually uses this classpath to resolve 'my.ws.Endpoint' : try to remove
the 'Classes' from the the classpath element, and java2wsdl fails to load the endpoint class...

Anyway, generating RPC style wsdl, axis seems to detect all dependant classes, and processes
properly both javabeans and exceptions that are mapped, as expected, as soap:fault in the
operation description.

It seems that axis doesn't use the same code in both cases...

> JAVA2WSDL (ant) with document/literal encoding
> ----------------------------------------------
>
>          Key: AXIS-1734
>          URL: http://nagoya.apache.org/jira/browse/AXIS-1734
>      Project: Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.2 Beta, 1.2RC2
>  Environment: Windows 2K SP4 / Ant 1.6 within Eclipse 3.0.1
> JDK 1.4.2_01-b06
>     Reporter: Ephemeris Lappis
>     Assignee: Davanum Srinivas
>  Attachments: AXIS-2.zip
>
> WSDL generation from Java, using document/literal encoding doesn't work when the code
uses custom data types and exceptions. Code for the endpoint interface, the data type and
exception are copied at the end of the message.
> From a first simple script, and then adding explicit mapping or complex type tags, i
did'nt find and way to make the generation work for this 'basic' example :
> Case 1 :
> --------
> In the ant task, if i just set the service interface classname, java2wsdl displays out
messages, asking for mappings for my exception and data types :
> 	<target name="wsdl">
> 		<property name="my.namespace" value="http://ws.moon.net/axis2" />
> 		<java2wsdl output="axis2.wsdl"
> 		           className="my.ws.Endpoint"
> 		           namespace="${my.namespace}"
> 		           portTypeName="SampleService"
> 		           servicePortName="SampleServicePort"
> 		           serviceElementName="MyService"
> 		           style="DOCUMENT"
> 		           use="LITERAL"
> 		           location="http://ws.moon.net/axis2">
> 			<classpath>
> 				<pathelement location="Classes" />
> 				<path refid="my.axis.classpath" />
> 			</classpath>
> 		</java2wsdl>
> 	</target>
> Console :
> [java2wsdl] - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart).
Attachment support is disabled.
> [java2wsdl] Java2WSDL my.ws.Endpoint
> [java2wsdl] - Please register a typemapping/beanmapping for 'my.ws.Structure'
> [java2wsdl] - Please register a typemapping/beanmapping for 'my.ws.ProblemException'
> Case 2 :
> ------
> If i add an explicit mapping on the package, the result is the same.
> 	<target name="wsdl">
> 		<property name="my.namespace" value="http://ws.moon.net/axis2" />
> 		<java2wsdl output="axis2.wsdl"
> 		           className="my.ws.Endpoint"
> 		           namespace="${my.namespace}"
> 		           portTypeName="SampleService"
> 		           servicePortName="SampleServicePort"
> 		           serviceElementName="MyService"
> 		           style="DOCUMENT"
> 		           use="LITERAL"
> 		           location="http://ws.moon.net/axis2">
> 			<classpath>
> 				<pathelement location="Classes" />
> 				<path refid="my.axis.classpath" />
> 			</classpath>
> 			<mapping package="my.ws" namespace="${my.namespace}" />
> 		</java2wsdl>
> 	</target>
> Case 3 :
> ------
> I add an explicit complex type tag for my data type. Axis task fails on resolving the
data type class.
> 	<target name="wsdl">
> 		<property name="my.namespace" value="http://ws.moon.net/axis2" />
> 		<java2wsdl output="axis2.wsdl"
> 		           className="my.ws.Endpoint"
> 		           namespace="${my.namespace}"
> 		           portTypeName="SampleService"
> 		           servicePortName="SampleServicePort"
> 		           serviceElementName="MyService"
> 		           style="DOCUMENT"
> 		           use="LITERAL"
> 		           location="http://ws.moon.net/axis2">
> 			<classpath>
> 				<pathelement location="Classes" />
> 				<path refid="my.axis.classpath" />
> 			</classpath>
> 			<mapping package="my.ws" namespace="${my.namespace}" />
> 			<complextype classname="my.ws.Structure"
> 			             namespace="${my.namespace}" />
> 		</java2wsdl>
> 	</target>
> Console :
> [java2wsdl] - Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart).
Attachment support is disabled.
> [java2wsdl] Java2WSDL my.ws.Endpoint
> [java2wsdl] java.lang.ClassNotFoundException: my.ws.Structure
> [java2wsdl] 	at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1149)
> [java2wsdl] 	at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1090)
> [java2wsdl] 	at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:960)
> [java2wsdl] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> [java2wsdl] 	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> [java2wsdl] 	at java.lang.Class.forName0(Native Method)
> [java2wsdl] 	at java.lang.Class.forName(Class.java:141)
> [java2wsdl] 	at org.apache.axis.tools.ant.wsdl.ComplexType.register(ComplexType.java:52)
> [java2wsdl] 	at org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask.execute(Java2WsdlAntTask.java:206)
> [java2wsdl] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> [java2wsdl] 	at org.apache.tools.ant.Task.perform(Task.java:364)
> [java2wsdl] 	at org.apache.tools.ant.Target.execute(Target.java:341)
> [java2wsdl] 	at org.apache.tools.ant.Target.performTasks(Target.java:369)
> [java2wsdl] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
> [java2wsdl] 	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:379)
> [java2wsdl] 	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)
> BUILD FAILED: D:\Data\Philippe\Atelier\Java\Eclipse-Workspace\AXIS-2\build.xml:25: Error
while running org.apache.axis.tools.ant.wsdl.Java2WsdlAntTask
> --- my/ws/Endpoint.java ---
> package my.ws;
> import java.rmi.Remote;
> import java.rmi.RemoteException;
> public interface Endpoint extends Remote {
> 	public String operation(Structure structure) throws ProblemException, RemoteException;
> }
> --- my/ws/Structure.java ---
> package my.ws;
> import java.io.Serializable;
> public class Structure implements Serializable {
> 	private String String;
> 	private int integer;
> 	public Structure() {
> 		this(null, 0);
> 	}
> 	public Structure(final String string, final int integer) {
> 		setString(string);
> 		setInteger(integer);
> 	}
> 	public void setString(final String string) {
> 		String = string;
> 	}
> 	public String getString() {
> 		return String;
> 	}
> 	public void setInteger(final int integer) {
> 		this.integer = integer;
> 	}
> 	public int getInteger() {
> 		return integer;
> 	}
> }
> --- my/ws/ProblemException.java ---
> package my.ws;
> public class ProblemException extends Exception {
> 	public ProblemException(final String message) {
> 		super(message);
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message