无法将名称 ... 解析为 (n) 'type definition' 组件
Cannot resolve the name ... to a(n) 'type definition' component
我想使用 wsimport 从 WSDL 文件导入代码,但我收到以下错误。
[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)
所以,代码生成了,但是编译的时候出现错误
这似乎是一个 WSIMPORT 错误,我不知道。
为了解决这个问题,我使用参数“-Xnocompile”来强制 WSIMPORT 只生成代码而不编译。
之后,我用 javac 通过命令行编译代码并将 类 放入 .jar
我将 .jar 添加到项目中,一切正常 运行。
我想使用 wsimport 从 WSDL 文件导入代码,但我收到以下错误。
[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)
所以,代码生成了,但是编译的时候出现错误
这似乎是一个 WSIMPORT 错误,我不知道。
为了解决这个问题,我使用参数“-Xnocompile”来强制 WSIMPORT 只生成代码而不编译。
之后,我用 javac 通过命令行编译代码并将 类 放入 .jar
我将 .jar 添加到项目中,一切正常 运行。