WebService Axis 1.4 não suporta java.util.ArrayList que objeto poderia me retornar

1 resposta
S

Olá
Estou tentando publicar esse metodo em um webservice que rertona um ArrayList :

public ArrayList<Endereco>  enderecoLista() {
		 System.out.println("entrei no metodo enderecoLista");
		  	 ArrayList<Endereco> listaEndereco = new ArrayList(); 
		      Endereco endereco = null;
		      
		      try  
		      {   
		        	  endereco = new Endereco();
		        	  endereco.setEndereco("Av. Paulista");
		        	  listaEndereco.add(endereco);

		        	  endereco = new Endereco();
		        	  endereco.setEndereco("Av. São João");
		        	  listaEndereco.add(endereco);
		        	  
		        	  endereco = new Endereco();
		        	  endereco.setEndereco("Av. Brigadeiro Luiz Antonio");
		        	  listaEndereco.add(endereco);
		        	  
		      } catch (Exception e) {
					e.printStackTrace();
				}   
		    
		  	   return listaEndereco;
}

Porem ele da esse erro :
The service class “br.com.enderecosDAO” does not comply to one or more
requirements of the JAX-RPC 1.1 specification, and may not deploy or function correctly.
The method “enderecoLista” on the service class “br.com.enderecosDAO” uses a data type, “java.util.ArrayList”,
that is not supported by the JAX-RPC specification. Instances of the type may not serialize or
deserialize correctly. Loss of data or complete failure of the Web service may result.

Se ele não suporta java.util.ArrayList que objeto poderia me retornar uma lista de endereços?

Grato

1 Resposta

alves.Felipe

e se vc retornar um array de Object? Object[]

Criado 1 de julho de 2010
Ultima resposta 1 de jul. de 2010
Respostas 1
Participantes 2