Reputation: 71
In process of up-gradation CXF jars from 2.2.12 to 3.1.6, I am facing issue with "exclude=true" attribute in @javax.jws.WebMethod annotation while building my project. I am getting following exception.
[java] Error: java.lang.RuntimeException: org.apache.cxf.jaxws.JaxWsConfigurationException: The @javax.jws.WebMethod(exclude=true) cannot be used on a service endpoint interface. Method: deleteFileInternal [java] Use the verbose setting to show the stacktrace of this error [java] JavaToWS Error: org.apache.cxf.tools.common.ToolException: org.apache.cxf.jaxws.JaxWsConfigurationException: The @javax.jws.WebMethod(exclude=true) cannot be used on a service endpoint interface.
This is due to, CXF 3.1.6 is not supporting "exclude=true" attribute while generation WSDL from java class if class is annotated with @javax.jws.WebService annotation.
Can someone please suggest the alternate solution for this?
Upvotes: 0
Views: 1640
Reputation: 39291
Do not use @javax.jws.WebMethod(exclude=true)
on the interface, just use it on the implementation
public class MyWebServiceImpl implements MyWebService {
...
@WebMethod(exclude = true)
String methodToExclude(String s) {
}
}
Also you can remove the method from interface
Upvotes: 0