Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2648

JaxWSClient Fail on legal interface - XmlSchemaException: Schema for namespace 'nn' already contains type 'tt'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.9
    • 2.2.6
    • Aegis Databinding
    • None

    Description

      Have interface with two methods. Each has parameter with same name but other type!

      @WebService(name="documents", targetNamespace="http://v1_0_0.ws.doc.daisy.marbes.cz")
      public interface Documents {
      
         void getDocumentByFilter( @WebParam(name="filter") VOFilter);
      
         void getDocumentByExtendedFilter( @WebParam(name="filter") VOExtendedFilter);
      
      }
      
      @XmlType(name = "SimpleFilter", namespace = NamespaceInfo.NAMESPACE_V1)
      public class VOFilter {
      ...
      }
      
      @XmlType(name = "ExtendedFilter", namespace = NamespaceInfo.NAMESPACE_V1)
      public class VOExtendedFilter {
      ...
      }
      
      

      On the server side all working. WSDL seems OK and method call by SOAPUI working too.

      But on the client side (when try to call by CXF client) exception is thrown :

      org.apache.ws.commons.schema.XmlSchemaException:  Schema for namespace 'http://wo.v1.ws.doc.modules.daisy.marbes.cz' already contains type 'filter'
      	at org.apache.ws.commons.schema.XmlSchema.addType(XmlSchema.java:558)
      	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:206)
      	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
      	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
      	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)
      	at org.apache.cxf.common.xmlschema.SchemaCollection.read(SchemaCollection.java:158)
      	at org.apache.cxf.databinding.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:136)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.createSchemas(AegisDatabinding.java:532)
      	at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:323)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:378)
      	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:530)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:437)
      	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:192)
      	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:165)
      	at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
      	at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
      	at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
      	at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
      

      Client code:

                  JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
                  factory.setServiceClass( Documents.class );
                  factory.setAddress(publishURL);
                  factory.setDataBinding(new AegisDatabinding());
      
                  Object remoteInterfaceImpl = factory.create();
      

      Server code:

              JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
              serverFactoryBean.setServiceClass(AopUtils.getTargetClass(implementor)); // Documents.class
              serverFactoryBean.setServiceBean(implementor);                          //DocumentsImpl
              serverFactoryBean.setDataBinding(new AegisDatabinding());
              serverFactoryBean.setAddress(url);
      
             serverFactoryBean.create();
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            cesnek Jara Cesnek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: