remigio
remigio

Reputation: 4211

No way to exclude method from being exposed by JAX-WS as web service operation

I'm creating a web service in Java EE 6 annotating an enterprise bean with @WebService. I need to expose only some of the bean methods, so I've annotated with @WebMethod only the required ones. Unfortunately JAX-WS ignores the annotations and try to expose all methods. The trouble is that there is one method, that's not intended to be used as a web service operation, that returns an interface and this cannot be managed by JAX-WS, so the web service is not deployed. Is this an expected behavior or am I missing something?

Upvotes: 8

Views: 4587

Answers (1)

Florian
Florian

Reputation: 1182

You could add the attribute 'exclude' to the annotation and set it to true. The Javadoc states: Marks a method to NOT be exposed as a web method.

Upvotes: 13

Related Questions