4 Replies Latest reply on Feb 4, 2008 4:05 AM by didi1976

    Problem importing multiple schema from the same namespace

    hugin78

      In my WS I use @WebService with the wsdlLocation. In my wsdl I have a type that use two external elements from the same namespace

       <import namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/" schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC_DistrictSubdivisionIdentifier.xsd"/>
       <import namespace="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/" schemaLocation="http://rep.oio.dk/ebxml/xml/schemas/dkcc/2005/03/15/DKCC_PostCodeIdentifier.xsd"/>
       <complexType name="KontaktInformationType">
       <sequence>
       <element ref="ebxml:DistrictSubdivisionIdentifier" minOccurs="0"/>
       <element ref="ebxml:PostCodeIdentifier" minOccurs="0"/>
       </sequence>
       </complexType>
      


      When I deploy the application the following is written in the log:


      2007-04-19 14:58:25,881 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_rep.oio.dk_wmdata.dk_as2007_schemas_2006_11_20_29281.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'ebxml:PostCodeIdentifier' to a(n) 'element declaration' component.
      



      It seems that it only reads the first import in the namespace as there are no problems with DistrictSubdivisionIdentifier.

      Even though it shows errors in the log it returns the elements as described though.

      What am I doing wrong





        • 1. Re: Problem importing multiple schema from the same namespac
          didi1976

          Is there any solution till now? We ran in a similar problem:

          A SLSB calls a WebService on a Bea WLI to trigger there some processing. The generated WSDL from the WLI looks like:

          <?xml version="1.0" encoding="utf-8"?>
          <wsdl:definitions
           xmlns:conv="http://www.openuri.org/2002/04/soap/conversation/"
           xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/"
           xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
           xmlns:jms="http://www.openuri.org/2002/04/wsdl/jms/"
           xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
           xmlns:s="http://www.w3.org/2001/XMLSchema"
           xmlns:s0="http://www.openuri.org/"
           xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
           xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
           targetNamespace="http://www.openuri.org/">
           <wsdl:types>
           <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:test="http://test.softsolution.at" elementFormDefault="qualified" targetNamespace="http://www.openuri.org/">
           <s:import namespace="http://test.softsolution.at"/>
           <s:element name="clientRequest">
           <s:complexType>
           <s:sequence>
           <s:element ref="test:AllParts"/>
           </s:sequence>
           </s:complexType>
           </s:element>
           <s:element name="clientRequestResponse">
           <s:complexType>
           <s:sequence/>
           </s:complexType>
           </s:element>
           </s:schema>
           <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test.softsolution.at" targetNamespace="http://test.softsolution.at" elementFormDefault="qualified" attributeFormDefault="unqualified">
           <xs:element name="AllParts">
           <xs:annotation>
           <xs:documentation>Combine PartA and PartB</xs:documentation>
           </xs:annotation>
           <xs:complexType>
           <xs:sequence>
           <xs:element ref="tns:PartA"/>
           <xs:element ref="tns:PartB"/>
           </xs:sequence>
           </xs:complexType>
           </xs:element>
           </xs:schema>
           <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test.softsolution.at" targetNamespace="http://test.softsolution.at" elementFormDefault="qualified" attributeFormDefault="unqualified">
           <xs:element name="PartA">
           <xs:annotation>
           <xs:documentation>First Part of the Test</xs:documentation>
           </xs:annotation>
           <xs:complexType>
           <xs:sequence>
           <xs:element name="ElementA" type="xs:string"/>
           <xs:element name="ElementB" type="xs:long"/>
           </xs:sequence>
           </xs:complexType>
           </xs:element>
           </xs:schema>
           <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://test.softsolution.at" targetNamespace="http://test.softsolution.at" elementFormDefault="qualified" attributeFormDefault="unqualified">
           <xs:element name="PartB">
           <xs:annotation>
           <xs:documentation>Second Part of the Test</xs:documentation>
           </xs:annotation>
           <xs:complexType>
           <xs:sequence>
           <xs:element name="ElementC" type="xs:string"/>
           <xs:element name="ElementD" type="xs:long"/>
           </xs:sequence>
           </xs:complexType>
           </xs:element>
           </xs:schema>
          
           </wsdl:types>
           <wsdl:message name="clientRequestSoapIn">
           <wsdl:part name="parameters" element="s0:clientRequest"/>
           </wsdl:message>
           <wsdl:message name="clientRequestSoapOut">
           <wsdl:part name="parameters" element="s0:clientRequestResponse"/>
           </wsdl:message>
           <wsdl:portType name="testAllPartsSoap">
           <wsdl:operation name="clientRequest">
           <wsdl:input message="s0:clientRequestSoapIn"/>
           <wsdl:output message="s0:clientRequestSoapOut"/>
           </wsdl:operation>
           </wsdl:portType>
           <wsdl:binding name="testAllPartsSoap" type="s0:testAllPartsSoap">
           <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
           <wsdl:operation name="clientRequest">
           <soap:operation soapAction="http://www.openuri.org/clientRequest" style="document"/>
           <wsdl:input>
           <soap:body use="literal"/>
           </wsdl:input>
           <wsdl:output>
           <soap:body use="literal"/>
           </wsdl:output>
           </wsdl:operation>
           </wsdl:binding>
           <wsdl:service name="testAllParts">
           <wsdl:port name="testAllPartsSoap" binding="s0:testAllPartsSoap">
           <soap:address location="http://xpscd:7001/TestWeb/testAllParts.jpd"/>
           </wsdl:port>
           </wsdl:service>
          </wsdl:definitions>
          


          The following error is logged by the JBoss Server (4.2.2.GA):

          2008-01-21 11:08:04,342 ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] JBossWS_www.openuri.org_23041.xsd[domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name 'test:AllParts' to a(n) 'element declaration' component.
          


          It seems that there is a problem in handling multiple schemas mapped to the same targetNamespace.

          The ws-client classes are generated and work correctly without any error if used directly with jax-ws.

          The error does not prevent the WebService from being called. So the error can be ignored (should it be ignored?).

          • 2. Re: Problem importing multiple schema from the same namespac
            didi1976

            I checked the WSDL-2.0 spec at http://www.w3.org/TR/wsdl20/.


            3.1.2 Inlining XML Schema
            ...
            A WSDL 2.0 document MAY inline two or more schemas from the same targetNamespace. For example, two or more inlined schemas can have the same targetNamespace provided that they do not define the same elements or types. A WSDL 2.0 document MUST NOT define the same element or type in more than one inlined schema.
            ...


            The server.log shows that only the last inlined schema seems to be recognized / remembered (see TypesMetaData):

            UnifiedMetaData:
             implementation: jbossws-native-2.0.1.SP2 (build=200710210837)
             deploymentName: null
             securityDomain: null
            
            ServiceMetaData:
             qname={http://www.openuri.org/}testAllParts
             refName=null
             wsdName=null
             wsdlFile=null
             wsdlLocation=file:/home/scd/workspace/TestWSDL/src/wsdl/testAllParts.wsdl
             jaxrpcMapping=null
             publishLocation=null
             securityConfig=null
             properties=null
            
            TypesMetaData:
            <schema targetNamespace='http://test.softsolution.at' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://www.openuri.org/' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.softsolution.at' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <import namespace='http://www.openuri.org/'/>
             <element name='PartB'>
             <complexType>
             <sequence>
             <element name='ElementC' type='string'/>
             <element name='ElementD' type='long'/>
             </sequence>
             </complexType>
             </element>
            </schema>
            <schema targetNamespace='http://www.openuri.org/' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://test.softsolution.at' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://www.openuri.org/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
             <import namespace='http://test.softsolution.at'/>
             <element name='clientRequest'>
             <complexType>
             <sequence/>
             </complexType>
             </element>
             <element name='clientRequestResponse'>
             <complexType/>
             </element>
            </schema>
            
            
            ClientEndpointMetaData:
             type=JAXWS
             qname={http://www.openuri.org/}testAllPartsSoap
             address=http://xpscd:7001/TestWeb/testAllParts.jpd
             binding=http://schemas.xmlsoap.org/wsdl/soap/http
             seiName=null
             configFile=META-INF/standard-jaxws-client-config.xml
             configName=Standard Client
             authMethod=null
             properties={}
            
            OperationMetaData:
             qname={http://www.openuri.org/}clientRequest
             javaName={http://www.openuri.org/}clientRequest
             style=document/literal/WRAPPED
             oneWay=false
             soapAction=http://www.openuri.org/clientRequest
            


            • 3. Re: Problem importing multiple schema from the same namespac
              asoldano

              WSDL 2.0 is not fully supported yet http://jbws.dyndns.org/mediawiki/index.php?title=JBossWSSpecStatus.
              However feel free to create a feature request issue in JIRA for your issue about imports so that we can evaluate it and perhaps fix it.

              • 4. Re: Problem importing multiple schema from the same namespac
                didi1976

                Created the JIRA Feature Request: http://jira.jboss.org/jira/browse/JBWS-1980