2 Replies Latest reply on Feb 23, 2007 9:47 AM by dlofthouse

    wstools problem generating WSDL from Java with inherited cla

    bgasst

      Hi,
      I generated a WSDL file with the wstools. So far so good, but I think, the generated section isn't correct.

      My simple example is the following:

      package test;
      public class FirstRequest {
      }
      
      package test;
      public class SecondRequest extends FirstRequest {
       public int id;
      }
      
      package test;
      public class Test1Request extends SecondRequest {
      }
      
      package test;
      public class Test2Request extends SecondRequest {
       public String dummy;
      }
      
      package test;
      import java.rmi.Remote;
      import java.rmi.RemoteException;
      public interface MyService extends Remote {
       void Test1(Test1Request req) throws RemoteException;
       void Test2(Test2Request req) throws RemoteException;
      }
      
      package test;
      import java.rmi.RemoteException;
      public class MyEndpointJSE implements MyService {
       public void Test1(Test1Request req) throws RemoteException {
       // TODO Auto-generated method stub
       }
       public void Test2(Test2Request req) throws RemoteException {
       // TODO Auto-generated method stub
       }
      }


      wstools-config.xml file:

      <configuration>
       <java-wsdl>
       <service name="SampleService" style="rpc" endpoint="test.MyService" />
       <namespaces target-namespace="http://my.domain.com/test/rpcstyle" type-namespace="http://my.domain.com/test/rpcstyle/types" />
       <mapping file="jaxrpc-mapping.xml" />
       <webservices servlet-link="SampleService" />
       </java-wsdl>
      </configuration>


      And here is the generated WSDL file (not complete):

      <definitions name='SampleService' targetNamespace='http://my.domain.com/test/rpcstyle' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://my.domain.com/test/rpcstyle/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://my.domain.com/test/rpcstyle' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
       <types>
       <schema targetNamespace='http://my.domain.com/test/rpcstyle/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://my.domain.com/test/rpcstyle/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <complexType name='FirstRequest'>
       <sequence/>
       </complexType>
       <complexType name='SecondRequest'>
       <complexContent>
       <extension base='tns:FirstRequest'>
       <sequence>
       <element name='id' type='int'/>
       </sequence>
       </extension>
       </complexContent>
       </complexType>
       <complexType name='Test1Request'>
       <complexContent>
       <extension base='tns:SecondRequest'>
       <sequence>
       <element name='id' type='int'/>
       </sequence>
       </extension>
       </complexContent>
       </complexType>
       <complexType name='Test2Request'>
       <complexContent>
       <extension base='tns:SecondRequest'>
       <sequence>
       <element name='dummy' nillable='true' type='string'/>
       </sequence>
       </extension>
       </complexContent>
       </complexType>
       </schema>
       </types>
      
       ...
      
      </definitions>


      How you can see, the member 'id' is only defined once in the class SecondRequest.

      But, could anyone explain me, why the element 'id' is double defined within the schema?

      If I define a 'dummy' string member in the class Test2Request, the second element 'id' is omitted within the schema!!!

      I'm working with jbossws-1.0.4.GA with Java 1.4.2

      Thanks in advance,
      Steven