1 Reply Latest reply on Apr 29, 2006 2:01 PM by thomas.diesler

    Resolving problems with inheritance

    klaus_erber

      Hello,

      at the moment, we are evaluating the new JBossWS webservice stack for a new project to use it instead of a self deployed AXIS context.

      First of all: Thank you for the great work!

      For the test, we have a CVS/SVN version of JBoss-4.0.4.GA/JBossWS from 2006-04-25

      We run into problems, when we try to use inheritance in our parameter und result types. For example:

      we have as JSR181 conforming class:

      package de.spiegel.red.service.ws.auth;
      @WebService( name="AuthentifizierungJws",
       targetNamespace="http://auth.ws.service.red.spiegel.de",
       serviceName="AuthentifizierungJws")
      @SOAPBinding(
       style=SOAPBinding.Style.RPC,
       use = SOAPBinding.Use.LITERAL)
      @Stateless
      public class AuthentifizierungJwsServiceBean extends CoreJwsServiceBean
       implements AuthentifizierungJws
      {
      ...
      
       @WebMethod
       public LoginErgebnis login(LoginParam loginParam)
       {
       ...
       }
      }
      

      The class LoginParam:

      package de.spiegel.red.service.ws.auth;
      public class LoginParam extends CoreParamWSO implements java.io.Serializable {
       ...
      }
      


      and the base class:

      package de.spiegel.red.service.ws;
      public class CoreParamWSO implements java.io.Serializable {
       private JwsParam jwsParam;
       ...
      
       public JwsParam getJwsParam() {
       return jwsParam;
       }
      
       public void setJwsParam(JwsParam jwsParam) {
       this.jwsParam = jwsParam;
       }
      }
      


      That results in the following WSDL, using the wstools:

      <definitions name='AuthentifizierungJws' targetNamespace='http://auth.ws.service.red.spiegel.de' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://ws.service.red.spiegel.de/jaws' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://auth.ws.service.red.spiegel.de' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
       <types>
       <schema targetNamespace='http://auth.ws.service.red.spiegel.de' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://ws.service.red.spiegel.de/jaws' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://auth.ws.service.red.spiegel.de' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <import namespace='http://ws.service.red.spiegel.de/jaws'/>
       <complexType name='JwsParam'>
       <sequence>
       <element name='clientVersion' nillable='true' type='string'/>
       <element name='tan' nillable='true' type='string'/>
       <element name='trace' nillable='true' type='boolean'/>
       </sequence>
       </complexType>
       ...
       <complexType name='LoginParam'>
       <complexContent>
       <extension base='tns:CoreParamWSO'>
       <sequence>
       <element name='organisation' nillable='true' type='string'/>
       <element name='password' nillable='true' type='string'/>
       <element name='token' nillable='true' type='string'/>
       <element name='userclientname' nillable='true' type='string'/>
       <element name='username' nillable='true' type='string'/>
       <element name='webserviceclientname' nillable='true' type='string'/>
       </sequence>
       </extension>
       </complexContent>
       </complexType>
       ...
       </schema>
       <schema targetNamespace='http://ws.service.red.spiegel.de/jaws' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://auth.ws.service.red.spiegel.de' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://ws.service.red.spiegel.de/jaws' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
       <import namespace='http://auth.ws.service.red.spiegel.de'/>
       <complexType name='CoreParamWSO'>
       <sequence>
       <element name='jwsParam' nillable='true' type='tns:JwsParam'/>
       </sequence>
       </complexType>
       ...
       <complexType name='JwsParam'>
       <sequence>
       <element name='clientVersion' nillable='true' type='string'/>
       <element name='tan' nillable='true' type='string'/>
       <element name='trace' nillable='true' type='boolean'/>
       </sequence>
       </complexType>
       ...
       </schema>
       </types>
       <message name='AuthentifizierungJws_login'>
       <part name='LoginParam_1' type='tns:LoginParam'/>
       </message>
       <message name='AuthentifizierungJws_loginResponse'>
       <part name='result' type='tns:LoginErgebnis'/>
       </message>
       ...
       <portType name='AuthentifizierungJws'>
       <operation name='login' parameterOrder='LoginParam_1'>
       <input message='tns:AuthentifizierungJws_login'/>
       <output message='tns:AuthentifizierungJws_loginResponse'/>
       </operation>
       ...
       </portType>
       <binding name='AuthentifizierungJwsBinding' type='tns:AuthentifizierungJws'>
       <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
       <operation name='login'>
       <soap:operation soapAction=''/>
       <input>
       <soap:body namespace='http://auth.ws.service.red.spiegel.de' use='literal'/>
       </input>
       <output>
       <soap:body namespace='http://auth.ws.service.red.spiegel.de' use='literal'/>
       </output>
       </operation>
       ...
       </binding>
       <service name='AuthentifizierungJws'>
       <port binding='tns:AuthentifizierungJwsBinding' name='AuthentifizierungJwsPort'>
       <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
       </port>
       </service>
      </definitions>
      



      During deployment we get these errors:

      2006-04-28 15:05:01,291 ERROR [ScannerThread] [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_auth.ws.service.red.spiegel.de16628.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'tns:CoreResultWSO' to a(n) 'type definition' component.
      2006-04-28 15:05:01,291 ERROR [ScannerThread] [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_auth.ws.service.red.spiegel.de16628.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'tns:CoreParamWSO' to a(n) 'type definition' component.
      2006-04-28 15:05:01,338 ERROR [ScannerThread] [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] [domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'tns:CoreResultWSO' to a(n) 'type definition' component.
      2006-04-28 15:05:01,338 ERROR [ScannerThread] [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] [domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'tns:CoreParamWSO' to a(n) 'type definition' component.
      2006-04-28 15:05:01,354 ERROR [ScannerThread] [org.jboss.deployment.MainDeployer] Could not start deployment: file:/C:/jboss-4.0.4.GA-ejb3/server/default/deploy/red-services.ear/red-services.jar/
      org.jboss.ws.WSException: Element jwsParam found in jaxrpc-mapping but not in the schema: {http://auth.ws.service.red.spiegel.de}LoginParam
       at org.jboss.ws.jaxb.SchemaBindingBuilder.processXmlElementName(SchemaBindingBuilder.java:278)
       at org.jboss.ws.jaxb.SchemaBindingBuilder.processNonArrayType(SchemaBindingBuilder.java:178)
       at org.jboss.ws.jaxb.SchemaBindingBuilder.processJavaXmlTypeMapping(SchemaBindingBuilder.java:138)
       at org.jboss.ws.jaxb.SchemaBindingBuilder.bindSchemaToJava(SchemaBindingBuilder.java:110)
       at org.jboss.ws.jaxb.SchemaBindingBuilder.buildSchemaBinding(SchemaBindingBuilder.java:90)
       at org.jboss.ws.metadata.ServiceMetaData.getSchemaBinding(ServiceMetaData.java:332)
       at org.jboss.ws.metadata.ServiceMetaData.eagerInitialize(ServiceMetaData.java:400)
       at org.jboss.ws.metadata.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:143)
       at org.jboss.ws.server.ServiceEndpoint.start(ServiceEndpoint.java:131)
       at org.jboss.ws.server.ServiceEndpointManager$DefaultServiceLifecycle.startServiceEndpoint(ServiceEndpointManager.java:513)
       at org.jboss.ws.server.ServiceEndpointManager$ServiceLifecycleChain.startServiceEndpoint(ServiceEndpointManager.java:458)
       at org.jboss.ws.server.ServiceEndpointManager.startServiceEndpoint(ServiceEndpointManager.java:427)
       ...
      



      ok, I can understand it. There is no type 'tns:CoreParamWSO' defined in JBossWS_auth.ws.service.red.spiegel.de16628.xsd, that is used as the extension base:

      ...
      <extension base='tns:CoreResultWSO'>
      ...
      


      There is one in JBossWS_ws.service.red.spiegel.de_jaws16629.xsd. But how can we avoid the problem? It seems that the non-jaws file have to include the jaws-file, or so. I have also try to put all classes in one java package, but the result is the same.

      best regards
      Klaus