Examples of WebFault


Examples of javax.xml.ws.WebFault

        if (wspAnn != null) {
            return true;
        }

        // Check for Exception
        WebFault wfAnn = (WebFault)getAnnotation(cls,WebFault.class);
        if (wfAnn != null) {
            return true;
        }

        // Check for Holder
View Full Code Here

Examples of javax.xml.ws.WebFault

        }
    }

    private QName getFaultName(Exception webFault) {
        QName faultName = null;
        WebFault wf = webFault.getClass().getAnnotation(WebFault.class);
        if (wf != null) {
            faultName = new QName(wf.targetNamespace(), wf.name());
        }
           
        return faultName;
    }
View Full Code Here

Examples of javax.xml.ws.WebFault

        Throwable cause = e.getCause();
        if (cause == null) {
            cause = e;
        }
        if (e instanceof Fault) {
            WebFault t = cause.getClass().getAnnotation(WebFault.class);
            if (t != null) {
                return t.name();
            }
        }
        return cause.getClass().getSimpleName();   
    }
View Full Code Here

Examples of javax.xml.ws.WebFault

        env.put(ToolConstants.CFG_WSDLURL,
                getLocation("/wsdl2java_wsdl/cxf964/hello_world_fault.wsdl"));     
        processor.setContext(env);
        processor.execute();
        Class<?> clz = classLoader.loadClass("org.apache.intfault.BadRecordLitFault");
        WebFault webFault = AnnotationUtil.getPrivClassAnnotation(clz, WebFault.class);
        assertEquals("int", webFault.name());
    }
View Full Code Here

Examples of javax.xml.ws.WebFault

        Object output;
        try {
            output = webMethod.invoke(pojo, new Object[] {input });
        } catch (InvocationTargetException e) {
            if (e.getCause() instanceof Exception) {
                WebFault fa = (WebFault) e.getCause().getClass().getAnnotation(WebFault.class);
                if (!(exchange instanceof InOnly) && fa != null) {
                    BaseFaultType info = (BaseFaultType) e.getCause().getClass().getMethod("getFaultInfo").invoke(
                            e.getCause());
                    Fault fault = exchange.createFault();
                    exchange.setFault(fault);
View Full Code Here

Examples of javax.xml.ws.WebFault

            QName qname = new QName(detail.getNamespaceURI(),
                                    detail.getName());
            Class<?>[] exceptions = method.getExceptionTypes();
            for (int i = 0; i < exceptions.length; i++) {
                LOG.debug("Checking exception: " + exceptions[i]);
                WebFault wf = exceptions[i].getAnnotation(WebFault.class);
                if (wf == null) {
                    LOG.debug("No WebFault annotation");
                    continue;
                }
                QName exceptionName = new QName(wf.targetNamespace(), wf.name());
                if (exceptionName.equals(qname)) {
                    try {
                        Method mth = exceptions[i].getMethod("getFaultInfo");
                        Class<?> infoClass = mth.getReturnType();
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

Examples of javax.xml.ws.WebFault

        Throwable cause = e.getCause();
        if (cause == null) {
            cause = e;
        }
        if (e instanceof Fault) {
            WebFault t = cause.getClass().getAnnotation(WebFault.class);
            if (t != null) {
                return t.name();
            }
        }
        return cause.getClass().getSimpleName();   
    }
View Full Code Here

Examples of javax.xml.ws.WebFault

        } catch (SecurityException e) {
            throw new ServiceConstructionException(e);
        } catch (NoSuchMethodException e) {
            //ignore for now
        }
        WebFault fault = exClass.getAnnotation(WebFault.class);
        if (fault != null && !StringUtils.isEmpty(fault.faultBean())) {
            try {
                return ClassLoaderUtils.loadClass(fault.faultBean(),
                                                   exClass);
            } catch (ClassNotFoundException e1) {
                //ignore
            }
        }
View Full Code Here

Examples of javax.xml.ws.WebFault

            return "result";
        }
        return null;
   
    public String getFaultMessageName(OperationInfo op, Class<?> exClass, Class<?> beanClass) {
        WebFault f = exClass.getAnnotation(WebFault.class);
        if (f != null) {
            return getWithReflection(WebFault.class, f, "messageName");
        }
        return null;
    }
View Full Code Here

Examples of javax.xml.ws.WebFault

        return PackageUtils.getPackageName(method.getDeclaringClass());
    }
   
    @Override
    public QName getFaultName(InterfaceInfo service, OperationInfo o, Class<?> exClass, Class<?> beanClass) {
        WebFault fault = exClass.getAnnotation(WebFault.class);
        if (fault != null) {
            String name = fault.name();
            if (name.length() == 0) {
                name = exClass.getSimpleName();
            }
            String ns = fault.targetNamespace();
            if (ns.length() == 0) {
                ns = service.getName().getNamespaceURI();
            }

            return new QName(ns, name);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.