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

WSDL2Java tool should be able to handle imports of other WSDL files into the original WSDL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Java-SCA-M2
    • Java-SCA-1.x
    • Java SCA Tools
    • None
    • Patch Available

    Description

      If I, for example, define my portType in one WSDL and then import that into another WSDL where I define my Service/Port, I will have problems, like the following when running WSDL2Java against the latter WSDL:

      Caused by: java.lang.NullPointerException
      at org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceEmitter.isWrapped(JavaInterfaceEmitter.java:136)
      at org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceEmitter.getInputElement(JavaInterfaceEmitter.java:171)
      at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.generateMethodElement(AxisServiceBasedMultiLanguageEmitter.java:1926)
      at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.loadOperations(AxisServiceBasedMultiLanguageEmitter.java:1841)
      at org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter.createDOMDocumentForInterface(AxisServiceBasedMultiLanguageEmitter.java:993)
      at org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceEmitter.writeInterface(JavaInterfaceEmitter.java:196)
      at org.apache.tuscany.tools.wsdl2java.generate.JavaInterfaceGenerator.generate(JavaInterfaceGenerator.java:200)

      I believe a key to the problem is the line in WSDL2JavaGenerator.generateFromWSDL():
      xsdHelper.define(inputStream, inputFile.toURI().toString());

      Though this method is called the EMF 'packageRegistry' field is essentially empty. I assume this is because XSDHelper.define(...) will not handle a WSDL import. (It does seem to be handling an XSD schema import, however). I don't know enough of the SDO APIs to suggest a better method than the xsdHelper.define(..) we're invoking, however.

      I'll attach an example

      Attachments

        1. Service.wsdl
          0.9 kB
          Scott Kurz
        2. PortType.wsdl
          1 kB
          Scott Kurz

        Activity

          People

            Unassigned Unassigned
            scottkurz Scott Kurz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: