WSDL com estrutura errada? Ajuda!

6 respostas
Tiago_Farias

Pessoal,
depois de uma semana pesquisando sobre webservices,wsdl, axis, xfire, cxf etc. e tentando gerar classes java a partir de um wsdl sem sucesso, começo a suspeitar q esse wsdl (q me foi dado pelo cliente) está errado. Não eh erro de sintaxe(pois ele é validado sem erros), mas talvez um erro de esquema ou estrutura. Visto q comecei a estudar isso faz menos de 15 dias, gostaria de obter uma luz de vcs mais experientes. Tem algo errado com esse wsdl abaixo? Não consigo gerar classe com framework nenhum! Sempre o mesmo erro: "Rpc/encoded wsdls are not supported in JAXWS 2.0"

<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
	xmlns:si="http://soapinterop.org/xsd"
	xmlns:tns="https://www.recife.pe.gov.br/common/webservice/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns="http://schemas.xmlsoap.org/wsdl/"
	targetNamespace="https://www.recife.pe.gov.br/common/webservice/">
	<types>
		<xsd:schema
			targetNamespace="https://www.recife.pe.gov.br/common/webservice/">
			<xsd:import
				namespace="http://schemas.xmlsoap.org/soap/encoding/" />
			<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
			<xsd:complexType name="arrAutenticacaoEMAC">
				<xsd:all>
					<xsd:element name="intCodigoErro" type="xsd:int" />
					<xsd:element name="bolResposta" type="xsd:boolean" />
					<xsd:element name="strMensagem" type="xsd:string" />
				</xsd:all>

			</xsd:complexType>
			<xsd:complexType name="arrGrupo">
				<xsd:complexContent> <!-- Isso foi adicionado como teste. Anteriormente, estava sem essa tag. Essa foi a única modificação -->
			
				<xsd:restriction base="SOAP-ENC:Array">
				
				</xsd:restriction>
			</xsd:complexContent>
			</xsd:complexType>
			<xsd:complexType name="arrListaFuncionario">
				<xsd:all>
					<xsd:element name="strNomeFuncionario"
						type="xsd:string" />
					<xsd:element name="intEmpresa" type="xsd:int" />

					<xsd:element name="strEmpresa" type="xsd:string" />
					<xsd:element name="intMatricula" type="xsd:int" />
					<xsd:element name="intEmpresaLotacao"
						type="xsd:int" />
					<xsd:element name="intSecretariaLotacao"
						type="xsd:int" />
					<xsd:element name="intOrgaoLotacao" type="xsd:int" />
					<xsd:element name="strEmailFuncionario"
						type="xsd:string" />
					<xsd:element name="arrGrupo" type="tns:arrGrupo" />
					<xsd:element name="intCodigoErro" type="xsd:int" />
					<xsd:element name="bolResposta" type="xsd:boolean" />

					<xsd:element name="strMensagem" type="xsd:string" />
				</xsd:all>
			</xsd:complexType>
			<xsd:complexType name="arrAlteraSenha">
				<xsd:all>
					<xsd:element name="bolResposta" type="xsd:boolean" />
					<xsd:element name="strMensagem" type="xsd:string" />
				</xsd:all>
			</xsd:complexType>

			<xsd:complexType name="arrUltimoAcesso">
				<xsd:all>
					<xsd:element name="bolResposta" type="xsd:boolean" />
					<xsd:element name="strMensagem" type="xsd:string" />
				</xsd:all>
			</xsd:complexType>
			<xsd:complexType name="arrFuncaoFuncionario">
		 	 <xsd:complexContent> <!-- Isso foi adicionado como teste. Anteriormente, estava sem essa tag. Essa foi a única modificação -->
			
				<xsd:restriction base="SOAP-ENC:Array">
				
				</xsd:restriction>
			</xsd:complexContent> 

			</xsd:complexType>
		</xsd:schema>
	</types>
	<message name="autenticaFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSenha" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="autenticaFuncionarioResponse">
		<part name="return" type="tns:arrListaFuncionario" />
	</message>
	<message name="autenticaFuncionarioFaltamNdiasExpiracaoRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSenha" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="autenticaFuncionarioFaltamNdiasExpiracaoResponse">
		<part name="return" type="tns:arrListaFuncionario" />
	</message>
	<message name="listaFuncaoFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="listaFuncaoFuncionarioResponse">
		<part name="return" type="tns:arrFuncaoFuncionario" />
	</message>
	<message name="gravarHistoricoFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="gravarHistoricoFuncionarioResponse">
		<part name="return" type="tns:arrUltimoAcesso" />
	</message>
	<message name="listaUltimoAcessoFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="listaUltimoAcessoFuncionarioResponse">
		<part name="return" type="xsd:string" />
	</message>
	<message name="listaLotacaoFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="intEmpresa" type="xsd:int" />
		<part name="intMatricula" type="xsd:int" />
	</message>
	<message name="listaLotacaoFuncionarioResponse">
		<part name="return" type="SOAP-ENC:Array" />
	</message>
	<message name="alteraSenhaFuncionarioRequest">
		<part name="strCPF" type="xsd:string" />
		<part name="strSenhaAntiga" type="xsd:string" />
		<part name="strSenhaNova" type="xsd:string" />
		<part name="strSistema" type="xsd:string" />
	</message>
	<message name="alteraSenhaFuncionarioResponse">
		<part name="code" type="xsd:int" />
		<part name="message" type="xsd:string" />
	</message>
	<portType name="WSEMACPortType">
		<operation name="autenticaFuncionario">
			<input message="tns:autenticaFuncionarioRequest" />
			<output message="tns:autenticaFuncionarioResponse" />
		</operation>
		<operation name="autenticaFuncionarioFaltamNdiasExpiracao">
			<input
				message="tns:autenticaFuncionarioFaltamNdiasExpiracaoRequest" />
			<output
				message="tns:autenticaFuncionarioFaltamNdiasExpiracaoResponse" />
		</operation>
		<operation name="listaFuncaoFuncionario">
			<input message="tns:listaFuncaoFuncionarioRequest" />
			<output message="tns:listaFuncaoFuncionarioResponse" />
		</operation>
		<operation name="gravarHistoricoFuncionario">
			<input message="tns:gravarHistoricoFuncionarioRequest" />
			<output message="tns:gravarHistoricoFuncionarioResponse" />
		</operation>
		<operation name="listaUltimoAcessoFuncionario">
			<input message="tns:listaUltimoAcessoFuncionarioRequest" />
			<output message="tns:listaUltimoAcessoFuncionarioResponse" />
		</operation>
		<operation name="listaLotacaoFuncionario">
			<input message="tns:listaLotacaoFuncionarioRequest" />
			<output message="tns:listaLotacaoFuncionarioResponse" />
		</operation>
		<operation name="alteraSenhaFuncionario">
			<input message="tns:alteraSenhaFuncionarioRequest" />
			<output message="tns:alteraSenhaFuncionarioResponse" />
		</operation>
	</portType>
	<binding name="WSEMACBinding" type="tns:WSEMACPortType">
		<soap:binding style="rpc"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<operation name="autenticaFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/autenticaFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="autenticaFuncionarioFaltamNdiasExpiracao">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/autenticaFuncionarioFaltamNdiasExpiracao"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="listaFuncaoFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/listaFuncaoFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="gravarHistoricoFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/gravarHistoricoFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="listaUltimoAcessoFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/listaUltimoAcessoFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="listaLotacaoFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/listaLotacaoFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
		<operation name="alteraSenhaFuncionario">
			<soap:operation
				soapAction="http://www.recife.pe.gov.br/common/webservice/EMAC/wsEMAC.php/alteraSenhaFuncionario"
				style="rpc" />
			<input>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</input>
			<output>
				<soap:body use="encoded"
					namespace="https://www.recife.pe.gov.br/common/webservice/"
					encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
			</output>
		</operation>
	</binding>
	<service name="WSEMAC">
		<port name="WSEMACPort" binding="tns:WSEMACBinding">
			<soap:address
				location="https://www.recife.pe.gov.br:443/common/webservice/EMAC/wsEMAC.php" />
		</port>
	</service>
</definitions>

Vlw povo!

6 Respostas

furutani

Olá

Eu uso WSDL RPC/encoded com Axis.
Já tentou gerar as classes com ele?

Tiago_Farias

Jah tentei cara. Por sinal, vc mesmo quem me instruiu o comando. =]
Mas ainda assim deu NoClassDefFoundError. Algum problema com classpath q não consegui responder… =/

T

É use algo para gerar suas classes sobre JAX-RPC que vai funcionar. por incrível que pareça o JDeveloper da Oracle manda razoavelmente bem nisso. (Versão Studio)

Tiago_Farias

Ok. Gerar classe com JAX-RPC. Algum framework, plugin…?

T

leu minha última mensagem???

Tiago_Farias

Olá TecnoAge,

rapaz, li sim. Na verdade eu me referia a algum plugin não muito grande q fizesse o trabalho sujo. Por exemplo, o XFire IDE e tal(q por sinal não funciona). O JDeveloper tem pra lá de 500mb, e eu soh quero pra gerar classe e nem tenho garantia de q funciona… não eh uma boa opção.
De qq forma, não posso deixar de agradecer a disponibilidade de vcs! =]

O Problema persiste…

Criado 4 de dezembro de 2008
Ultima resposta 5 de dez. de 2008
Respostas 6
Participantes 3