[ 
http://issues.apache.org/jira/browse/AXIS-1734?page=comments#action_60290 ]
     
Ephemeris Lappis commented on AXIS-1734:
----------------------------------------

I'm sorry, again !
The java2wsdl still fails when the beans and exceptions classes are not in the 
taskdef classpath : the ant task classpath is taken into account for the main 
service class, but is ignored for the other types. Note again that this just 
occurs using document style, and that all work as expected using RPC mode.
Just to precise the context : for test programs, it's not very important, since 
a single ant script is generally used, but for real applications, we generally 
use ant imports to set global definitions, and the sub-projects scripts just 
invoke tasks with specific classpaths.
I thing you may reopen this : Sorry again...



> JAVA2WSDL (ant) with document/literal encoding
> ----------------------------------------------
>
>          Key: AXIS-1734
>          URL: http://issues.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://issues.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

Reply via email to