1
Hello! I’m starting now in the world of Webservices. I made a WS in the eclipse Wizard using Axis 1 (if I’m not mistaken), in the style "Bottom up": No eclipse, positioned in the class that will be the WS: File->New->Other->Web Service (Code of the class below).
It turns out that "Client" and "Address" are in the "model" package. In the WSDL generation Axis specifies these objects in the model namespace (mod:), but the RETURN web service specifies the main namespace in the return (), in the NO specifies the namespace http://modelo.costa.regis for Customer and Address fields.
What is missing here? Any notes in the class? How do I return the class, which is actually the object itself, is sent in the correct namespace?
Thanks for any tips people. I’m kind of desperate here.
CODE OF THE CLASS: package Regis.costa;
import Regis.costa.model.Client; import Regis.costa.model.Address;
public class Cadcliente { public Client alteraClient(Client clientAtual) { Customer clienteNovo = new Customer();
clienteNovo.setCodigo(clienteAtual.getCodigo());
clienteNovo.setNome("Olá " + clienteAtual.getNome().toUpperCase());
Endereco[] anterior = clienteAtual.getEnderecos();
int quant = anterior.length;
quant++;
Endereco[] enderecos = new Endereco[quant];
for (int i = 0; i < anterior.length; i++) {
enderecos[i] = anterior[i];
}
enderecos[--quant] = new Endereco();
enderecos[quant].setBairro("novo bairro");
enderecos[quant].setNumero(111);
enderecos[quant].setRua("nova rua");
clienteNovo.setEnderecos(enderecos);
return clienteNovo;
}
}