2 Replies Latest reply on Jun 22, 2005 9:44 AM by jason.greene

    Handling types defined in multiple schemas

    thomas.diesler

      Hi folks,

      A type maybe defined in multiple schemas. To illustrate this, I use the example from the admin devel test.

       <schema targetNamespace="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservice/admindevel" xmlns:tns="http://org.jboss.webservice/example/types/arrays/org/jboss/test/webservice/admindevel" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://org.jboss.webservice/example/types" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema">
       <import namespace="http://org.jboss.webservice/example/types"/>
       <complexType name="HelloObjArray">
       <sequence>
       <element name="value" type="ns2:HelloObj" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
       </sequence>
       </complexType>
       </schema>
      


       <schema targetNamespace="http://org.jboss.webservice/example/types" xmlns:tns="http://org.jboss.webservice/example/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://org.jboss.webservice/example/types/arrays/org/jboss/test/webservice/admindevel"/>
       <complexType name="HelloObj">
       <sequence>
       <element name="msg" type="string" nillable="true"/>
       </sequence>
       </complexType>
       </schema>
      


      Currently when marshalling the HelloObjArray type, we give the marshalling layer an URL that points to the schema of the namespace associated with that type.

      Marshalling fails with

      Caused by: java.lang.IllegalStateException: Failed to marshal wildcard. Class mapping not found for org.jboss.test.webservice.admindevel.HelloObj@940b84
      at org.jboss.xml.binding.XercesXsMarshaller.marshalWildcard(XercesXsMarshaller.java:491)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:465)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalModelGroupSequence(XercesXsMarshaller.java:583)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalModelGroup(XercesXsMarshaller.java:538)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:462)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:449)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalElementType(XercesXsMarshaller.java:354)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalElement(XercesXsMarshaller.java:320)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:469)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalModelGroupSequence(XercesXsMarshaller.java:583)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalModelGroup(XercesXsMarshaller.java:538)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalParticle(XercesXsMarshaller.java:462)
      at org.jboss.xml.binding.XercesXsMarshaller.marshalComplexType(XercesXsMarshaller.java:449)
      at org.jboss.xml.binding.XercesXsMarshaller.marshallInternal(XercesXsMarshaller.java:176)
      at org.jboss.xml.binding.XercesXsMarshaller.marshal(XercesXsMarshaller.java:141)
      at org.jboss.ws.jaxb.JAXBMarshallerImpl.marshal(JAXBMarshallerImpl.java:89)


      I can see two potential solutions to that

      1) We change the contract with the marshalling layer, such that it will be given the complete set of schema definitions

      2) The WS layer rewrites the schema set to a single composite schema definition.

      This has been assigned to

      http://jira.jboss.org/jira/browse/JBWS-268

      What are your thought?