简体   繁体   中英

What is the alternative solution for @javax.jws.WebMethod(exclude=true)?

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM