Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-3869

WSDL data types not generated correctly

    XMLWordPrintableJSON

Details

    Description

      When a @Remotable interface receives or returns a POJO, the WSDL generated when using <binding.ws /> is not valid.
      This limits the applicability of <binding.ws /> to methods receiving or returning primitive types or wrappers only.

      If the WSDL is loaded in SoapUI, the following error is thrown:

      Fri Jun 03 11:43:04 EDT 2011:WARN:Error: http://localhost:8090/Registration?wsdl:0: error: src-resolve.a: Could not find type 'conference@http://dc.simple/'. Do you mean to refer to the type named conference (in Registration_3Fwsdl)?

      It seems that the namespace being used for the type definition is missing or misplaced


      More information:

      Mail thread
      http://mail-archives.apache.org/mod_mbox/tuscany-user/201106.mbox/%3CBANLkTimh6bBUWuCumea9iFX8wtyrDW0SvA@mail.gmail.com%3E

      Sample project to reproduce the issue:
      http://cid-6f107cd11157608a.office.live.com/self.aspx/Tuscany/02.SimpleWS.zip

      The offending WSDL
      http://cid-6f107cd11157608a.office.live.com/self.aspx/Tuscany/Registration.wsdl

      Scott Kurz has indicated this is probably related to
      https://issues.apache.org/jira/browse/TUSCANY-3298

      Info on the 1.x issue already resolved
      http://www.mail-archive.com/dev%40tuscany.apache.org/msg10002.html


      Copy of the original mail thread

      Hi there

      I am building a composite using the Tuscany 2.0-Beta2, The composite includes a single component with one service. After compiling, the contribution loads in Tuscany with no issues. I can even open the WSDL in the browser, but when trying to test the service I get the following exception in SoapUI/AdarnaStorm/EclipseWTP:

      Fri Jun 03 11:43:04 EDT 2011:WARN:Error: http://localhost:8090/Registration?wsdl:0: error: src-resolve.a: Could not find type 'conference@http://dc.simple/'. Do you mean to refer to the type named conference (in Registration_3Fwsdl)?

      I hit a wall with this problem, I have searched the web quite a lot but nothing. It may be a trivial setting that I am overlooking in my code.

      Basically, the contribution is supposed to be a service to register for a conference. It has three very simple classes, and the composite definition:

      // -------------------------------
      // The Conference POJO: Conference.java
      package simple.dc.model;

      public class Conference {

      private int id;
      private String topic;

      // Here getters and setters generated by Eclipse
      }

      // -------------------------------
      // The remotable interface: Registration.java

      package simple.dc;

      import org.oasisopen.sca.annotation.Remotable;
      import simple.dc.model.Conference;

      @Remotable
      public interface Registration {
      public int register(Conference conference);
      }

      // -------------------------------
      // The component implementation: RegistrationImpl.java

      package simple.dc.impl;

      import org.oasisopen.sca.annotation.Service;
      import simple.dc.Registration;
      import simple.dc.model.Conference;

      @Service(Registration.class)
      public class RegistrationImpl implements Registration {

      @Override
      public int register(Conference conference)

      { System.out.println("Registering for conference: " + conference.getTopic()); return 1234; //confirmation number }

      }

      // -------------------------------
      // The composite: SimpleWS.composite

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
      xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
      name="SimpleWSComposite"
      targetNamespace="http://dc.simple">

      <component name="RegistrationComponent">
      <implementation.java class="simple.dc.impl.RegistrationImpl"/>
      <service name="Registration">
      <binding.ws uri="http://localhost:8090/Registration"/>
      </service>
      </component>

      </composite>

      No errors or warnings during compilation. I am using Gradle with the following dependencies:

      compile group: 'org.apache.tuscany.sca', name: 'tuscany-base-runtime', version: '2.0-Beta2'
      compile group: 'org.apache.tuscany.sca', name: 'tuscany-binding-ws-runtime-axis2', version: '2.0-Beta2'
      compile group: 'org.apache.tuscany.sca', name: 'tuscany-host-jetty', version: '2.0-Beta2'
      compile group: 'org.apache.tuscany.sca', name: 'tuscany-host-http', version: '2.0-Beta2'

      I install the contribution using bin\tuscany.bat. This is what Tuscany reports once loaded:

      default> installed
      main file:/C:/Users/dcueva/Documents/SimpleWS/build/classes/main/
      SimpleWS.composite

      {http://dc.simple}

      SimpleWSComposite **running**

      default> services
      RegistrationComponent/Registration
      binding.ws http://localhost:8090/Registration

      The generated WSDL does not seem to be valid. I will attach it to this email.
      I have used several tools to test the WSDL:

      SoapUI 3.6.1 says:

      Fri Jun 03 11:43:04 EDT 2011:WARN:Error: http://localhost:8090/Registration?wsdl:0: error: src-resolve.a: Could not find type 'conference@http://dc.simple/'. Do you mean to refer to the type named conference (in Registration_3Fwsdl)?

      Adarna Storm 1.1 says:

      System.InvalidOperationException: Unable to import binding 'RegistrationBinding' from namespace 'http://dc.simple/'. ---> System.InvalidOperationException: Unable to import operation 'register'. ---> System.InvalidOperationException: The datatype 'http://dc.simple/:conference' is missing.
      at System.Xml.Serialization.XmlSchemaImporter.FindDataType(XmlQualifiedName name, TypeFlags flags)

      When validating with wclipse WTP says:

      • schema_reference.4: Failed to read schema document 'null', because 1) could not find the document; 2) the
        document could not be read; 3) the root element of the document is not <xsd:schema>.
        On the following line (warning):
        <xs:import />
      • src-resolve: Cannot resolve the name 'conference' to a 'type definition' component.
        On the following line (error):
        <xs:element minOccurs="0" name="arg0" nillable="true" type="conference" />

      It seems to be a problem with the namespaces int he generated WSDL. I have changed the namespace declaration in my composite to try various forms, but it did not work.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dcueva David Cueva
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: