2016-07-07 101 views
-1

我想用wsimport從WSDL文件導入代碼,但我在下面收到此錯誤。無法解析名稱...到(n)'類型定義'組件

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

這裏的WSDL文件...

<?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> 

有人可以給我一些啓示?謝謝!

編輯1:

這只是一個警告。真正的錯誤是

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)

因此,代碼已生成,但編譯時發生錯誤。

回答

0

它似乎是一個WSIMPORT錯誤,我不知道。

爲了解決這個問題,我使用param「-Xnocompile」來強制WSIMPORT只生成沒有編譯的代碼。

之後,我通過編譯用javac命令行代碼,並把類放入一個.jar

我加入的.jar到項目,一切都運行良好。

相關問題