Vamsavardhana Reddy wrote:


On Tue, Jul 22, 2008 at 4:49 PM, Simon Nash <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Scott Kurz wrote:

        The root cause here seems to be the same or similar to the one in:
        https://issues.apache.org/jira/browse/TUSCANY-2479
        (not that pointing that out brings us closer to a solution).

        I did also discover that externalizing every schema the way
        wsgen's WSDL output does leads to another problem:
        https://issues.apache.org/jira/browse/TUSCANY-2481

        though I'd guess the latter shouldn't be too hard to fix.

        Scott

        On Fri, Jul 18, 2008 at 5:01 PM, Raymond Feng
        <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
        <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:

           Hi,
               The bottom of the problem is as follows:
               1) The WSDL has more than one inline schemas with
        different target
           namespaces.
           2) An inline schema references the other inline schema for
        XSD types
           or elements.
               We are supposed to have <xsd:import> statements in the
        inline schemas.

    I don't think it's the lack of xsd:import that's causing this problem.

    The schema definition for
    http://jaxb.databindings.itest.sca.tuscany.apache.org/
    is referencing types using an ns0: prefix, which resolves to
    http://util.java/.
    However, there is no schema definition with this targetNamespace.
     The first
    thing that needs fixing is to add
    targetNamespace="http://util.java/"; to the
    first schema definition (the one that defines arrayList etc.) and see if
    that resolves the problem.

    Vamsi, could you try editing the generated WSDL to add this
    targetNamespace
    attribute and see if the modified WSDL can be loaded by the Tuscany
    runtime?

Thanks Simon. The WSDL got loaded and the testcase ran fine after adding targetNamespace="http://util.java/"; as you suggested.

Is that all you had to do to get this through wsimport without errors?  I had
to make quite a few other changes, including adding an import for
"http://util.java/"; and moving the "http://util.java/"; schema definition to
a separate file.

  Simon



    If this works, we need to figure out why the first schema is
    (apparently)
    coming back from JAXB without a targetNamespace specified.

     Simon

           There are a few issues:
               1) No <xsd:import> statements are generated by our J2W.
        IMO, the
           <xsd:import> is required.
           2) There is no standard way to specify the @schemaLocation
        for the
           <xsd:import> to reference another inline schema. I have
        personally
           seen different behaviors from various runtimes and tools, for
        example:
               * wsimport uses the #types?schemaN
           * EMF parser automatically search the inline schemas to match the
           <xsd:imports> if no @schemaLocation is present
               We have to figure out:
           1) What style of WSDL with multiple XSDs to be generated?
        Inline all
           XSDs (one file) or externalize all XSDs (WSDL and XSD files
        need to
           be downloaded from ?wsdl URL)?
           2) What's the most compatible style of the @schemaLocation if
           <xsd:import> or <xsd:include> is needed?
               Thanks,
           Raymond

           *From:* Vamsavardhana Reddy <mailto:[EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>>
           *Sent:* Friday, July 18, 2008 1:11 PM
           *To:* [EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>
        <mailto:[EMAIL PROTECTED]
        <mailto:[EMAIL PROTECTED]>>

           *Subject:* Problem using wsdl generated by ?wsdl with
        interface.wsdl
           as well as wsimport

           I have the following java interface:

           package org.apache.tuscany.sca.itest.databindings.jaxb;

           @Remotable
           public interface HelloService {
               String getGreetings(String name);
               String[] getGreetingsArray(String[] names);
               List<String> getGreetingsList(List<String> names);
               ArrayList<String> getGreetingsArrayList(ArrayList<String>
        names);
               Map<String, String> getGreetingsMap(Map<String, String>
        namesMap);
               HashMap<String, String> getGreetingsHashMap(HashMap<String,
           String> namesMap);
               String getGreetingsVarArgs(String... names);
           }

           I have obtained the following wsdl using ?wsdl on a service which
           uses interface.java with the above interface:

           <?xml version="1.0" encoding="UTF-8"?>
           <wsdl:definitions name="HelloService"
targetNamespace="http://jaxb.databindings.itest.sca.tuscany.apache.org/"; xmlns:tns="http://jaxb.databindings.itest.sca.tuscany.apache.org/";
               xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/";
               xmlns:xs="http://www.w3.org/2001/XMLSchema";
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
               xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
               <wsdl:types>
                   <xs:schema version="1.0"
                       xmlns:xs="http://www.w3.org/2001/XMLSchema";>
                       <xs:complexType name="arrayList">
                           <xs:complexContent>
                               <xs:extension base="abstractList">
                                   <xs:sequence />
                               </xs:extension>
                           </xs:complexContent>
                       </xs:complexType>
                       <xs:complexType abstract="true" name="abstractList">
                           <xs:complexContent>
                               <xs:extension base="abstractCollection">
                                   <xs:sequence />
                               </xs:extension>
                           </xs:complexContent>
                       </xs:complexType>
                       <xs:complexType abstract="true"
        name="abstractCollection">
                           <xs:sequence />
                       </xs:complexType>
                       <xs:complexType name="hashMap">
                           <xs:complexContent>
                               <xs:extension base="abstractMap">
                                   <xs:sequence />
                               </xs:extension>
                           </xs:complexContent>
                       </xs:complexType>
                       <xs:complexType abstract="true" name="abstractMap">
                           <xs:sequence />
                       </xs:complexType>
                   </xs:schema>
                   <xs:schema
        targetNamespace="http://jaxb.dev.java.net/array";
                       version="1.0"
        xmlns:xs="http://www.w3.org/2001/XMLSchema";>
                       <xs:complexType final="#all" name="stringArray">
                           <xs:sequence>
                               <xs:element maxOccurs="unbounded"
        minOccurs="0"
                                   name="item" nillable="true"
        type="xs:string" />
                           </xs:sequence>
                       </xs:complexType>
                   </xs:schema>
                   <xs:schema attributeFormDefault="qualified"
                       elementFormDefault="unqualified"
targetNamespace="http://jaxb.databindings.itest.sca.tuscany.apache.org/";
                       xmlns:ns0="http://util.java/";
                       xmlns:xs="http://www.w3.org/2001/XMLSchema";>
                       <xs:element name="getGreetings">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="arg0"
                                       nillable="true" type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true" type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsArray">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element maxOccurs="unbounded"
        minOccurs="0"
                                       name="arg0" nillable="true"
           type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsArrayResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element maxOccurs="unbounded"
        minOccurs="0"
                                       name="return" nillable="true"
           type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsList">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="arg0"
                                       nillable="true" type="xs:anyType" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsListResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true" type="xs:anyType" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsArrayList">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="arg0"
                                       nillable="true"
        type="ns0:arrayList" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsArrayListResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true"
        type="ns0:arrayList" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsMap">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="arg0"
                                       nillable="true" type="xs:anyType" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsMapResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true" type="xs:anyType" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsHashMap">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="arg0"
                                       nillable="true" type="ns0:hashMap" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsHashMapResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true" type="ns0:hashMap" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsVarArgs">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element maxOccurs="unbounded"
        minOccurs="0"
                                       name="arg0" nillable="true"
           type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                       <xs:element name="getGreetingsVarArgsResponse">
                           <xs:complexType>
                               <xs:sequence>
                                   <xs:element minOccurs="0" name="return"
                                       nillable="true" type="xs:string" />
                               </xs:sequence>
                           </xs:complexType>
                       </xs:element>
                   </xs:schema>
               </wsdl:types>
               <wsdl:message name="getGreetings">
                   <wsdl:part name="getGreetings"
        element="tns:getGreetings">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsResponse">
                   <wsdl:part name="getGreetingsResponse"
                       element="tns:getGreetingsResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsArray">
                   <wsdl:part name="getGreetingsArray"
                       element="tns:getGreetingsArray">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsArrayResponse">
                   <wsdl:part name="getGreetingsArrayResponse"
                       element="tns:getGreetingsArrayResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsList">
                   <wsdl:part name="getGreetingsList"
                       element="tns:getGreetingsList">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsListResponse">
                   <wsdl:part name="getGreetingsListResponse"
                       element="tns:getGreetingsListResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsArrayList">
                   <wsdl:part name="getGreetingsArrayList"
                       element="tns:getGreetingsArrayList">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsArrayListResponse">
                   <wsdl:part name="getGreetingsArrayListResponse"
                       element="tns:getGreetingsArrayListResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsMap">
                   <wsdl:part name="getGreetingsMap"
                       element="tns:getGreetingsMap">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsMapResponse">
                   <wsdl:part name="getGreetingsMapResponse"
                       element="tns:getGreetingsMapResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsHashMap">
                   <wsdl:part name="getGreetingsHashMap"
                       element="tns:getGreetingsHashMap">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsHashMapResponse">
                   <wsdl:part name="getGreetingsHashMapResponse"
                       element="tns:getGreetingsHashMapResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsVarArgs">
                   <wsdl:part name="getGreetingsVarArgs"
                       element="tns:getGreetingsVarArgs">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:message name="getGreetingsVarArgsResponse">
                   <wsdl:part name="getGreetingsVarArgsResponse"
                       element="tns:getGreetingsVarArgsResponse">
                   </wsdl:part>
               </wsdl:message>
               <wsdl:portType name="HelloService">
                   <wsdl:operation name="getGreetings">
                       <wsdl:input message="tns:getGreetings"></wsdl:input>
                       <wsdl:output message="tns:getGreetingsResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsArray">
                       <wsdl:input
        message="tns:getGreetingsArray"></wsdl:input>
                       <wsdl:output message="tns:getGreetingsArrayResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsList">
                       <wsdl:input
        message="tns:getGreetingsList"></wsdl:input>
                       <wsdl:output message="tns:getGreetingsListResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsArrayList">
                       <wsdl:input message="tns:getGreetingsArrayList">
                       </wsdl:input>
                       <wsdl:output
        message="tns:getGreetingsArrayListResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsMap">
                       <wsdl:input message="tns:getGreetingsMap">
                       </wsdl:input>
                       <wsdl:output message="tns:getGreetingsMapResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsHashMap">
                       <wsdl:input
        message="tns:getGreetingsHashMap"></wsdl:input>
                       <wsdl:output
        message="tns:getGreetingsHashMapResponse">
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsVarArgs">
                       <wsdl:input message="tns:getGreetingsVarArgs">
                       </wsdl:input>
                       <wsdl:output
        message="tns:getGreetingsVarArgsResponse">
                       </wsdl:output>
                   </wsdl:operation>
               </wsdl:portType>
               <wsdl:binding name="HelloServiceBinding"
        type="tns:HelloService">
                   <soap11:binding style="document"
                       transport="http://schemas.xmlsoap.org/soap/http"; />
                   <wsdl:operation name="getGreetings">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsArray">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsList">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsArrayList">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsMap">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsHashMap">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
                   <wsdl:operation name="getGreetingsVarArgs">
                       <soap11:operation />
                       <wsdl:input>
                           <soap11:body use="literal" />
                       </wsdl:input>
                       <wsdl:output>
                           <soap11:body use="literal" />
                       </wsdl:output>
                   </wsdl:operation>
               </wsdl:binding>
               <wsdl:service name="HelloServiceService">
                   <wsdl:port name="HelloServicePort"
                       binding="tns:HelloServiceBinding">
                       <soap11:address
        location="http://localhost:8085/hs-ep"; />
                   </wsdl:port>
               </wsdl:service>
           </wsdl:definitions>

           When I use the above wsdl with wsimport, I am getting an
        error.  The
           following is the output in the command window:
           D:\T\databinding> \JAXWS\jaxws-ri\bin\wsimport -keep -s hhll
           hello-service.wsdl
           parsing WSDL...

           [WARNING] src-resolve.4.2: Error resolving component
           'ns0:arrayList'. It was det
           ected that 'ns0:arrayList' is in namespace
        'http://util.java/', but
           components f
           rom this namespace are not referenceable from schema document
           'file:/D:/T/databi
           nding/hello-service.wsdl#types?schema3'. If this is the incorrect
           namespace, per
           haps the prefix of 'ns0:arrayList' needs to be changed. If
        this is
           the correct n
           amespace, then an appropriate 'import' tag should be added to
           'file:/D:/T/databi
           nding/hello-service.wsdl#types?schema3'.
             line 127 of
        file:/D:/T/databinding/hello-service.wsdl#types?schema3

           [ERROR] undefined simple or complex type 'ns0:arrayList'
             line 127 of file:/D:/T/databinding/hello-service.wsdl

           [ERROR] undefined simple or complex type 'ns0:arrayList'
             line 135 of file:/D:/T/databinding/hello-service.wsdl

           [ERROR] undefined simple or complex type 'ns0:hashMap'
             line 159 of file:/D:/T/databinding/hello-service.wsdl

           [ERROR] undefined simple or complex type 'ns0:hashMap'
             line 167 of file:/D:/T/databinding/hello-service.wsdl

           When I add the above wsdl document to my contribution and try
        to use
           interface.wsdl in place of interface.java, I am getting the
           following exception:
           java.lang.NullPointerException
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.updateSchemaRefs(Axis2ServiceProvider.java:527)
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.addSchemas(Axis2ServiceProvider.java:519)
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.createWSDLAxisService(Axis2ServiceProvider.java:486)
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.createAxisService(Axis2ServiceProvider.java:377)
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.start(Axis2ServiceProvider.java:264)
               at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceBindingProvider.start(Axis2ServiceBindingProvider.java:65)
               at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl$3.run(CompositeActivatorImpl.java:618)
               at java.security.AccessController.doPrivileged(Native Method)
               at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:616)
               at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:548)
               at
org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:613)
               at
org.apache.tuscany.sca.itest.databindings.jaxb.topdown.DatabindingTestCase.setUp(DatabindingTestCase.java:53)
               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
        Method)
               at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               at java.lang.reflect.Method.invoke(Method.java:585)
               at
org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
               at
org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
               at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
               at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
               at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
               at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
               at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
               at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
               at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
               at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

           Can someone help me figure the problem? Thanks in advance.

           ++Vamsi





Reply via email to