Error adding attribute name to @WebService

1

I am creating the class that implements the WS call and trying to include the name attribute, this error appears:

"@WebService annotation contains an endpointInterface attribute. No name attribute allowed"

Does anyone know why? If I remove the name attribute, the service is published, but with the name of the class. I'm using Eclipse Neon and JAVA 8.

The following is an excerpt from the code:

[...]

@WebService(name="incluirConta", endpointInterface="br.com.ws.teste.prestacao.IncluirContaWSService", portName="IncluirContaWSService", serviceName="endpoints")

@Stateless public class IncluirContasImpl extends BaseServico implements IncluirContas { //metodos omitidos... }
    
asked by anonymous 22.09.2017 / 15:13

1 answer

0

This is a specific validation of an Eclipse JAX-WS plugin (class ) . While validations give good tips, they are not necessarily mistakes. The JAX-WS implementation developer can do as he or she sees fit.

That said, in your case I think it really makes sense to move the name to the interface:

@WebService(name="IncluirConta",
    targetNamespace="http://algum.namespace.com",
    wsdlLocation="http://meu.dominio.com/ServicoConta?wsdl")
public interface IncluirContaSEI

@WebService(endpointInterface="br.com.ws.teste.prestacao.IncluirContaSEI",
    portName="IncluirContaPort", 
    serviceName="IncluirContaService")
public class IncluirContaPortImpl extends BaseServico implements IncluirContaSEI

For more information, consult the documentation for your JAX-WS implementation. E.g., Apache CXF

    
22.09.2017 / 17:09