Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8169981

wsgen -wsdl can't generate WebMethod in schema for the parent class of a WebService class

XMLWordPrintable

      Run wsgen t.Foo2 -wsdl against the following java files:
      Foo1.java:
      package t;
      import javax.jws.WebService;
      import javax.jws.WebMethod;

      public class Foo1 {
          @WebMethod
          public String method1(String str) {
              return str;
          }
      }

      Foo2.java:
      package t;
      import javax.jws.WebService;
      import javax.jws.WebMethod;

      @WebService
      public class Foo2 extends Foo1{
          @WebMethod
          public String method3(String str) {
              return str;
          }
      }

      generate Foo2Service_schema1.xsd
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <xs:schema version="1.0" targetNamespace="http://t/" xmlns:tns="http://t/" xmlns:xs="http://www.w3.org/2001/XMLSchema">

        <xs:element name="method3" type="tns:method3"/>

        <xs:element name="method3Response" type="tns:method3Response"/>

        <xs:complexType name="method3">
          <xs:sequence>
            <xs:element name="arg0" type="xs:string" minOccurs="0"/>
          </xs:sequence>
        </xs:complexType>

        <xs:complexType name="method3Response">
          <xs:sequence>
            <xs:element name="return" type="xs:string" minOccurs="0"/>
          </xs:sequence>
        </xs:complexType>
      </xs:schema>

      and a Foo2Service_schema2.xsd
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">

        <xs:element name="arg0" nillable="true" type="xs:string"/>

        <xs:element name="return" nillable="true" type="xs:string"/>
      </xs:schema>


      method1 is lost in the schema.

        1. 8170370_8170042_backported.patch
          15 kB
          Aleksej Efimov
        2. Foo2Service_schema_withBackportedFix.xsd
          1 kB
          Aleksej Efimov
        3. JDK-8170370_backported.patch
          8 kB
          Aleksej Efimov

            aefimov Aleksej Efimov
            fyuan Frank Yuan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: