Czy ktoś może mi wyjaśnić następujące zachowanie CXF?Jak wykluczyć metodę z CXF WebService - dziwne zachowanie
Mam proste WebService:
import javax.jws.WebMethod;
public interface MyWebService {
@WebMethod
String method1(String s);
@WebMethod
String method2(String s);
@WebMethod(exclude = true)
String methodToExclude(String s);
}
Chcę mieć mój methodToExclude
interfejs (na wiosnę), ale nie chcę mieć tej metody w wygenerowanym pliku WSDL. Powyższy kod robi dokładnie to.
Ale kiedy dodać @WebService
adnotacji do interfejsu otrzymuję błąd:
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public interface MyWebService {
@WebMethod
String method1(String s);
@WebMethod
String method2(String s);
@WebMethod(exclude = true)
String methodToExclude(String s);
}
org.apache.cxf.jaxws.JaxWsConfigurationException: The @javax.jws.WebMethod(exclude=true) cannot be used on a service endpoint interface. Method: methodToExclude
Czy ktoś może mi to wyjaśnić? Co za różnica? Również nie jestem pewien, czy to będzie działać dobrze później, ale nie znalazłem sposób, aby wykluczyć methodToExclude
, gdy używam @WebService
.
@Betlista nie może sobie pozwolić na wykupienie methodToExclude z interfejsu w celu zaspokojenia Spring, wszystko co musi zrobić, to włączyć '@WebMethod (exclude = true)' tylko w implementacji. –