Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-1566

Invalid wsdl using @XmlSchema annotations on Types

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jbossws-2.0.0
    • jbossws-1.2.0
    • jbossws-native
    • None

      While the @javax.xml.bind.annotation.XmlSchema annotation within the package-info.java of an class not inheriting from other packages works perfectly, JBossWS generates the following error for derived datatypes:

      <code>
      14:35:02,173 ERROR [ServiceEndpointPublisher] Cannot obtain waURL for: webservice-test.ear/webservic
      e-test.jar
      14:35:02,283 ERROR [JBossXSErrorHandler] [domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolv
      e.4.2]::Message=src-resolve.4.2: Error resolving component 'ns1:aClass'. It was detected that 'ns1:a
      Class' is in namespace 'http://test.org/wsclient/a', but components from this namespace are not refe
      renceable from schema document 'null'. If this is the incorrect namespace, perhaps the prefix of 'ns
      1:aClass' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag sh
      ould be added to 'null'.
      <code>

      The Parameter classes causing this problem are a.AClass, b.Bclass defined in the packages a, and b with the following package-info.java @XmlSchema annotations:

      The following examples will be attached as a patch for the jbossws-samples, too but are given here for a short summary on the problem.

      file a/package-info.java:

      ------
      @javax.xml.bind.annotation.XmlSchema(namespace = http://test.org/wsclient/a" )
      package a;
      ------

      file a/AClass.java:
      ------
      package a;
      public class AClass {
      int a;

      public int getA()

      { return a; }

      public void setA(int testInt)

      { this.a = testInt; }

      }
      ------

      file b/package-info.java:
      ------
      @javax.xml.bind.annotation.XmlSchema(namespace = http://test.org/wsclient/b" )
      package b;
      ------

      file b/BClass.java
      ------
      package b;

      public class BClass extends a.AClass {
      String b;

      public String getB()

      { return b; }

      public void setB(String testString)

      { this.b = testString; }

      }
      ------

      The relevant part of the generated WSDL (which is visible under jbossws/service is:

      <xs:schema targetNamespace="http://test.org/wsclient/b" version="1.0">
      <xs:complexType name="bClass">
      <xs:complexContent>
      <xs:extension base="ns1:aClass">
      <xs:sequence>
      <xs:element minOccurs="0" name="b" type="xs:string"/>
      </xs:sequence>
      </xs:extension>
      </xs:complexContent>
      </xs:complexType>
      </xs:schema>
      <xs:schema targetNamespace="http://test.org/wsclient/a" version="1.0">
      <xs:complexType name="aClass">
      <xs:sequence>
      <xs:element name="a" type="xs:int"/>
      </xs:sequence>
      </xs:complexType>
      </xs:schema>

      where the declaration of bClass references the ns1 namespace without declaring it.

      The same thing happens when aClass is aggreagated by bClass.

            rhn-support-hbraun Heiko Braun
            centecbertl Robert Mlekus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: