Here are a pair of WSDL files and an Ant file to generate the Java. Ant libraries (jar files) should be in a directory called axis_lib. My current version is Axis2 1.3 (downloaded 13/09/2007). Reminder: the issue is when port and binding have the same name, generated Java files are overwritten.
Note that the same WSDL files have been tested with Axis (1.2) and JAX-WS RI and work fine in both cases. In fact these WSDLs have been derived from production ones. * Results from the "diff" version: - port and binding have different names - The generated code doesn't compile. I don't know why. I'd say it is a distinct problem. Any idea to make it compile? - There are two stubs: * BuzzerSoapBindingStub, which may be used by a client to invoke the service * BuzzerSoapStub, which is the interface of the service * Results from the same version: - in the "same" version, port and binding have the same name. There is a missing class, the binding stub class (for calling the service). Obviously, it seems to have been overwritten by the interface stub. - note that if we use overwrite="true", the overwrite is the other way round: we have the binding stub class, but not the interface! Any help would be appreciated. Julien > -----Message d'origine----- > De : Amila Suriarachchi [mailto:[EMAIL PROTECTED] > Envoyé : mardi 6 novembre 2007 05:32 > À : axis-user@ws.apache.org > Objet : Re: port name and binding name overwriting > > can you send your wsdl or a sample wsdl to show the problem? > > Amila. > > > On 11/5/07, ROBINSON JULIEN < > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > wrote: > > > Hi all, > > I'm generating code from a WSDL using > org.apache.axis2.tool.ant.AntCodegenTask > > In my WSDL, the service definition looks like this: > > <wsdl:service name="someService"> > <wsdl:documentation>Blabla</wsdl:documentation> > <wsdl:port name="someServiceSoap" > binding="myns:someServiceSoap"> > <soap:address > > location="http://localhost:8080/jarname/services/some " /> > </wsdl:port> > </wsdl:service> > > Note that the port name and binding name are the same. > This works fine > for Axis 1 and JAX-WS RI, but Axis2 generates two > classes, one for the > port type (interface describing the port) and one for > the binding > (utility for calling an instance). > > Problem is, one of these classes overwrites the other > one! So that the > other one, overwritten, is missing in the generated package. > > I have several WSDL files in my project, some are > editable but others > are legacy, and I don't want to edit them. Plus, as I > said, this works > fine with other tools. > > Is there any way, possibly a bug fix or simply a > configuration of the > WSDL2Java (codegen) task, for a workaround? Perhaps to > tell it to > generate binding somewhere else? > > Thanks for any tips! > Julien
<?xml version="1.0" ?> <project name="Axis2 duplicate test" default="runtest" basedir="."> <path id="axis2.classpath"> <fileset dir="axis_lib"> <include name="**/*.jar"/> </fileset> </path> <target name="init"> <mkdir dir="diff"/> <mkdir dir="same"/> </target> <target name="clean"> <delete dir="diff"/> <delete dir="same"/> </target> <taskdef name="axis2-wsdl2java" classname="org.apache.axis2.tool.ant.AntCodegenTask" classpathref="axis2.classpath"/> <presetdef name="mywsdl2java"> <axis2-wsdl2java targetresourcesfolderlocation="ressources" targetsourcefolderlocation="src" language="java" synconly="true" serverside="true" generateservicexml="true" generateallclasses="true" unpackClasses="true" serverSideInterface="true" allports="false" testcase="no" unwrap="true" backwardcompatible="true" /> </presetdef> <target name="wsdl2java_same" depends="init"> <mywsdl2java wsdlfilename="buzzer_same.wsdl" output="same/output"/> </target> <target name="wsdl2java_diff" depends="init"> <mywsdl2java wsdlfilename="buzzer_diff.wsdl" output="diff/output"/> </target> <target name="runtest" depends="wsdl2java_diff, wsdl2java_same"/> </project>
buzzer_diff.wsdl
Description: buzzer_diff.wsdl
buzzer_same.wsdl
Description: buzzer_same.wsdl
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]