Search in sources :

Example 1 with JaxWsConfigurationException

use of org.apache.cxf.jaxws.JaxWsConfigurationException in project cxf by apache.

the class JaxWsServiceConfiguration method isOperation.

@Override
public Boolean isOperation(final Method method) {
    if (Object.class.equals(method.getDeclaringClass())) {
        return false;
    }
    if (method.getDeclaringClass() == implInfo.getSEIClass()) {
        WebMethod wm = method.getAnnotation(WebMethod.class);
        if (wm != null && wm.exclude()) {
            Message message = new Message("WEBMETHOD_EXCLUDE_NOT_ALLOWED", LOG, method.getName());
            throw new JaxWsConfigurationException(message);
        }
    }
    Class<?> implClz = implInfo.getImplementorClass();
    Method m = getDeclaredMethod(implClz, method);
    if (m != null) {
        WebMethod wm = m.getAnnotation(WebMethod.class);
        if (wm != null && wm.exclude()) {
            return Boolean.FALSE;
        }
    }
    if (isWebMethod(m)) {
        return true;
    }
    return isWebMethod(getDeclaredMethod(method));
}
Also used : WebMethod(javax.jws.WebMethod) JaxWsConfigurationException(org.apache.cxf.jaxws.JaxWsConfigurationException) Message(org.apache.cxf.common.i18n.Message) Method(java.lang.reflect.Method) WebMethod(javax.jws.WebMethod)

Example 2 with JaxWsConfigurationException

use of org.apache.cxf.jaxws.JaxWsConfigurationException in project cxf by apache.

the class JaxWsServiceConfiguration method isWrapped.

@Override
public Boolean isWrapped(Method m) {
    // see if someone overrode the default value
    if (getServiceFactory().getWrapped() != null) {
        return getServiceFactory().getWrapped();
    }
    m = getDeclaredMethod(m);
    SOAPBinding ann = m.getAnnotation(SOAPBinding.class);
    if (ann != null) {
        if (ann.style().equals(Style.RPC)) {
            Message message = new Message("SOAPBinding_MESSAGE_RPC", LOG, m.getName());
            throw new Fault(new JaxWsConfigurationException(message));
        }
        return !(ann.parameterStyle().equals(ParameterStyle.BARE));
    }
    return isWrapped();
}
Also used : JaxWsConfigurationException(org.apache.cxf.jaxws.JaxWsConfigurationException) Message(org.apache.cxf.common.i18n.Message) SOAPBinding(javax.jws.soap.SOAPBinding) Fault(org.apache.cxf.interceptor.Fault) WebFault(javax.xml.ws.WebFault)

Aggregations

Message (org.apache.cxf.common.i18n.Message)2 JaxWsConfigurationException (org.apache.cxf.jaxws.JaxWsConfigurationException)2 Method (java.lang.reflect.Method)1 WebMethod (javax.jws.WebMethod)1 SOAPBinding (javax.jws.soap.SOAPBinding)1 WebFault (javax.xml.ws.WebFault)1 Fault (org.apache.cxf.interceptor.Fault)1