Return from Webservice does not respect the namespace of my own WSDL

Asked

Viewed 92 times

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;
}

}

1 answer

0

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

The inexplicable Axis generated the programs of the new Webservice (Interface, Soapbindingimpl, Service, Servicelocator, Soapbindingstub and Soapbindingskeleton). I don’t know why it generated all these programs, what happens is that this new WS generated totally respects the WSDL. From then on I started making any changes I need in Webservice via WSDL and running the server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.