Error including name attribute in @Webservice

Asked

Viewed 52 times

1

I am creating the class that implements the WS call and when 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 attribute name, the service is published, but with the name of the class. I’m using Eclipse Neon and JAVA 8.

Follow below, 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... }

1 answer

0


This is a specific validation of a Eclipse JAX-WS plugin (class). While validations give good tips, they’re not necessarily errors. The developer of the JAX-WS implementation can do whatever they want.

That said, in your case I believe it makes real 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 see the documentation for your JAX-WS implementation. E.g., Apache CXF

Browser other questions tagged

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