WebService Return does not respect the namespace of my own WSDL



  • Hello! I'm starting now in the world of Webservices. I did a WS in the eclipse wizard using axis 1 (if I'm not mistaken), in the style "Bottom up": In the eclipse, positioned in the class that will be the WS: File->New->Other->Web Service (Ccode of the class below).

    It follows that "Cliente" and "Endereco" are in the "model" package. In the WSDL generation the axis specifies these objects in the model namespace (mod:), but the web service RETOR specifies the main namespace in the return (), in the NEM specifies the namespace http://modelo.costa.regis for the Customer and Address fields.

    What's missing here? Any notes in class? How do I return the class, which is actually the object itself, be sent in the correct namespace?

    Thank you for any tip people. I'm kind of desperate here.

    CLASS CODE: package regis.costa;

    import regis.costa.model. Client; import regis.costa.model. Address;

    public class CadCliente { public Client alterCliente(Cliente clientAtual) { Customer Client New = 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;
    

    }

    )



  • Problem solved. I took the WSDL generated by the Bottom Up method, and managed a NEW Webserver Server by the Top Down method.

    The unexplained Axis generated the programs of the new Webservice (Interface, SoapBindingImpl, Service, ServiceLocator, SoapBindingStub and SoapBindingSkeleton). I don't know why generated all these programs, what happens is that this new WS generated fully respects the WSDL. From there I started making any changes I need on Webservice via WSDL and running the server.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2