axis-wsdl2java used with 'extension base' is producing wrong number of 
constructor arguments
--------------------------------------------------------------------------------------------

         Key: AXIS-2165
         URL: http://issues.apache.org/jira/browse/AXIS-2165
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.2.1    
 Environment: Linux, java 1.4.2
    Reporter: trebor iksrazal


I have produced a simple test case, which works as expected with JWSDP 
wscompile, but does not work as expected with axis-wsdl2java. 

With wscompile, the generated class constructor is: 

   public ReturnWeb_Login(java.lang.String errorMessage, int successErrorCode, 
java.lang.String SOAP_Session_id, java.lang.String web_user_name) {
        this.errorMessage = errorMessage;
        this.successErrorCode = successErrorCode;
        this.SOAP_Session_id = SOAP_Session_id;
        this.web_user_name = web_user_name;
    }

With axis-wsdl2java, the generated class constructor is: 

   public ReturnWeb_Login(
           java.lang.String SOAP_Session_id,
           java.lang.String web_user_name) {
           this.SOAP_Session_id = SOAP_Session_id;
           this.web_user_name = web_user_name;
    }


WSDL:

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="CallCentreWebService" 
targetNamespace="http://com/callcentreweb"; xmlns:tns="http://com/callcentreweb"; 
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://com/callcentreweb/types";>
  <types>
    <schema targetNamespace="http://com/callcentreweb/types"; 
xmlns:tns="http://com/callcentreweb/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/"/>
      <complexType name="ReturnWeb_Base">
        <sequence>
          <element name="errorMessage" type="string"/>
          <element name="successErrorCode" type="int"/></sequence></complexType>
      <complexType name="ReturnWeb_Login">
        <complexContent>
          <extension base="tns:ReturnWeb_Base">
            <sequence>
              <element name="SOAP_Session_id" type="string"/>
              <element name="web_user_name" 
type="string"/></sequence></extension></complexContent></complexType>
</schema></types>
  <message name="CallCentreWebEndpoint_web_Login">
    <part name="user_name" type="xsd:string"/>
    <part name="user_password" type="xsd:string"/>
  </message>
  <message name="CallCentreWebEndpoint_web_LoginResponse">
    <part name="result" type="ns2:ReturnWeb_Login"/>
  </message>
  <portType name="CallCentreWebEndpoint">
    <operation name="web_Login" parameterOrder="user_name user_password">
      <input message="tns:CallCentreWebEndpoint_web_Login"/>
      <output message="tns:CallCentreWebEndpoint_web_LoginResponse"/>
    </operation>
  </portType>
  <binding name="CallCentreWebEndpointBinding" type="tns:CallCentreWebEndpoint">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; style="rpc"/>
    <operation name="web_Login">
      <soap:operation soapAction=""/>
      <input>
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
use="encoded" namespace="http://com/callcentreweb"/></input>
      <output>
        <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
use="encoded" 
namespace="http://com/callcentreweb"/></output></operation></binding>
  <service name="CallCentreWebService">
    <port name="CallCentreWebEndpointPort" 
binding="tns:CallCentreWebEndpointBinding">
      <soap:address location="http://127.0.0.1"/></port></service></definitions>


axis-wsdl2java definition: 

  <target name="my-wsdl2java" description="Generate compiled complex interfaces 
and classes from wsdl as a jar for an IDE" depends="clean,prepare">
       <echo message="Creating the custom complex objects using IBM tools...." 
/>
       <delete dir="resources/axis/com" />
       <axis-wsdl2java
         output="resources/axis"
         verbose="true"
         url="resources/axis-jira.wsdl"
         >
         <mapping
           namespace="http://com/hostedtelecom/callcentreweb";
           package="com.hostedtelecom.callcentreweb.endpoint" />
       </axis-wsdl2java>
       <echo message="Creating the IDE custom complex objects JAR" />
      <javac srcdir="resources/axis" destdir="${build}" debug="true"> 
        <include name="**/*.java" /> 
       <classpath refid="classpath-jboss"/> 
      </javac> 
       <copy todir="${build}">
         <fileset dir="resources/axis">
           <include name="**/*.class"/>
         </fileset>
       </copy>
       <jar jarfile="lib/soap-ide_only.jar" >
          <fileset dir="${build}" />
       </jar>
      <delete dir="${build}" />
   </target>

wscompile ant task: 

<taskdef name="wscompile" classname="com.sun.xml.rpc.tools.ant.Wscompile">
       <classpath refid="classpath-jboss"/> 
  </taskdef>

  <!--
  Note that this task only 
  works if you specifically have tools.jar in the classpath. 
  Alternatively, run: 
  wscompile.sh -import   -mapping resources/CallCentreWeb_Mapping.xml 
resources/config-wsdl.xml
  -->
  <target name="sun-wscompile" description="Generate compiled complex 
interfaces and classes from wsdl as a jar for an IDE" depends="clean,prepare">
       <echo message="Creating the custom complex objects using SUN tools...." 
/>
       <delete dir="resources/sun/com" />
       <wscompile
             fork="true"
             base="resources/sun"
             import="true"
             mapping="resources/CallCentreWeb_Mapping.xml"
             verbose="true"
             debug="true"
             sourceBase="resources/sun"
             config="resources/config-wsdl.xml">
             <classpath refid="classpath-jboss"/> 
       </wscompile>
       <echo message="Creating the IDE custom complex objects JAR" />
       <copy todir="${build}">
         <fileset dir="resources">
           <include name="**/*.class"/>
         </fileset>
       </copy>
       <jar jarfile="lib/soap-ide_only.jar" >
          <fileset dir="${build}" />
       </jar>
      <delete dir="${build}" />
   </target>

wscompile dependency for : 
             config="resources/config-wsdl.xml">

<configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config";>
    <wsdl location="resources/axis-jira.wsdl" 
packageName="com.hostedtelecom.callcentreweb.endpoint">
    </wsdl>
</configuration>

Note :
            mapping="resources/CallCentreWeb_Mapping.xml"

is an wscompile output file. 

Please advise if I can clarify further. Regards,
iksrazal




-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to