Search code examples
javawsdlwsimport

Cannot resolve the name ... to a(n) 'type definition' component


I want to import code from a WSDL file with wsimport, but i receiving this error below.

[WARNING] src-resolve: Cannot resolve the name 'impl:ArrayOf_tns1_IndicadorVO' to a(n) 'type definition' component.

Here's the WSDL file...

<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://ws.cnmpind.cnmp.gov.br" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ws.cnmpind.cnmp.gov.br" xmlns:intf="http://ws.cnmpind.cnmp.gov.br" xmlns:tns1="http://vo.ws.cnmpind.cnmp.gov.br" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://ws.cnmpind.cnmp.gov.br" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://vo.ws.cnmpind.cnmp.gov.br"/>
   <element name="getQuestionariosDisponiveis">
    <complexType>
     <sequence>
      <element name="email" type="xsd:string"/>
      <element name="senha" type="xsd:string"/>
      <element name="dataInicio" type="xsd:string"/>
      <element name="dataFinal" type="xsd:string"/>
      <element name="areaAtuacao" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getQuestionariosDisponiveisResponse">
    <complexType>
     <sequence>
      <element maxOccurs="unbounded" name="getQuestionariosDisponiveisReturn" type="tns1:QuestionarioVO"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="ArrayOf_tns1_IndicadorVO">
    <sequence>
     <element maxOccurs="unbounded" minOccurs="0" name="item" type="tns1:IndicadorVO"/>
    </sequence>
   </complexType>
   <element name="salvaRespostasQuestionarios">
    <complexType>
     <sequence>
      <element name="email" type="xsd:string"/>
      <element name="senha" type="xsd:string"/>
      <element name="dataInicio" type="xsd:string"/>
      <element name="dataFinal" type="xsd:string"/>
      <element name="areaAtuacao" type="xsd:string"/>
      <element maxOccurs="unbounded" name="questionarios" type="tns1:QuestionarioVO"/>
     </sequence>
    </complexType>
   </element>
   <element name="salvaRespostasQuestionariosResponse">
    <complexType/>
   </element>
  </schema>
  <schema elementFormDefault="qualified" targetNamespace="http://vo.ws.cnmpind.cnmp.gov.br" xmlns="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://ws.cnmpind.cnmp.gov.br"/>
   <complexType name="IndicadorVO">
    <sequence>
     <element name="descricaoDescritor" nillable="true" type="xsd:string"/>
     <element name="id" type="xsd:long"/>
     <element name="idDescritor" type="xsd:int"/>
     <element name="idIndicadorPai" type="xsd:long"/>
     <element name="idQuestionario" type="xsd:long"/>
     <element name="nomeDescritor" nillable="true" type="xsd:string"/>
     <element name="ordem" type="xsd:int"/>
     <element name="tamanhoDescritor" nillable="true" type="xsd:decimal"/>
     <element name="tipoDescritor" nillable="true" type="xsd:string"/>
     <element name="valor" nillable="true" type="xsd:decimal"/>
    </sequence>
   </complexType>
   <complexType name="QuestionarioVO">
    <sequence>
     <element name="aberto" type="xsd:boolean"/>
     <element name="dataAtualizacao" nillable="true" type="xsd:string"/>
     <element name="dataInicio" nillable="true" type="xsd:string"/>
     <element name="dataTermino" nillable="true" type="xsd:string"/>
     <element name="descricaoArea" nillable="true" type="xsd:string"/>
     <element name="id" type="xsd:long"/>
     <element name="idArea" type="xsd:int"/>
     <element name="idUnidade" type="xsd:int"/>
     <element name="indicadores" nillable="true" type="impl:ArrayOf_tns1_IndicadorVO"/>
     <element name="nomeArea" nillable="true" type="xsd:string"/>
     <element name="nomeUnidade" nillable="true" type="xsd:string"/>
     <element name="nomeUsuarioAtualizacao" nillable="true" type="xsd:string"/>
     <element name="siglaUnidade" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

   <wsdl:message name="salvaRespostasQuestionariosResponse">

      <wsdl:part element="impl:salvaRespostasQuestionariosResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="getQuestionariosDisponiveisResponse">

      <wsdl:part element="impl:getQuestionariosDisponiveisResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="getQuestionariosDisponiveisRequest">

      <wsdl:part element="impl:getQuestionariosDisponiveis" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="salvaRespostasQuestionariosRequest">

      <wsdl:part element="impl:salvaRespostasQuestionarios" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="QuestionarioWS">

      <wsdl:operation name="getQuestionariosDisponiveis">

         <wsdl:input message="impl:getQuestionariosDisponiveisRequest" name="getQuestionariosDisponiveisRequest"/>

         <wsdl:output message="impl:getQuestionariosDisponiveisResponse" name="getQuestionariosDisponiveisResponse"/>

      </wsdl:operation>

      <wsdl:operation name="salvaRespostasQuestionarios">

         <wsdl:input message="impl:salvaRespostasQuestionariosRequest" name="salvaRespostasQuestionariosRequest"/>

         <wsdl:output message="impl:salvaRespostasQuestionariosResponse" name="salvaRespostasQuestionariosResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="QuestionarioWSSoapBinding" type="impl:QuestionarioWS">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getQuestionariosDisponiveis">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getQuestionariosDisponiveisRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getQuestionariosDisponiveisResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

      <wsdl:operation name="salvaRespostasQuestionarios">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="salvaRespostasQuestionariosRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="salvaRespostasQuestionariosResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="QuestionarioWSService">

      <wsdl:port binding="impl:QuestionarioWSSoapBinding" name="QuestionarioWS">

         <wsdlsoap:address location="http://aplicativos.cnmp.gov.br/cnmpind/services/QuestionarioWS"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Someone can give me some light? Thanks!

EDIT 1:

This is just a warning. The true error is

package-info.java:1: error: error while writing package-info: could not create parent directories @javax.xml.bind.annotation.XmlSchema(namespace = "http://ws.cnmpind.cnmp.gov.br", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)

So, the code was generated, but the error happens when compiling.


Solution

  • Its seems to be a WSIMPORT bug, i don't know.

    To solve the problem, I used the param "-Xnocompile" to force WSIMPORT only generate the code whithout compiling.

    After that, i compiled the code by command line with javac and put the classes into a .jar

    I added the .jar to the project and everything are running fine.