Package javax.xml.ws

Examples of javax.xml.ws.WebFault.targetNamespace()


    public static QName getElementName(Class<? extends Throwable> exceptionClass) {
        WebFault webFault = exceptionClass.getAnnotation(WebFault.class);
        String namespace = null;
        String name = null;
        if (webFault != null) {
            namespace = webFault.targetNamespace();
            name = webFault.name();
        }
        if (namespace == null) {
            namespace = JavaInterfaceUtil.getNamespace(exceptionClass);
        }
View Full Code Here


        env.put(ToolConstants.CFG_SERVICENAME, "HelloWorldService");
        processor.setContext(env);
        processor.execute();
        Class cls = classLoader.loadClass("org.apache.cxf.hello_world_jms.BadRecordLitFault");
        WebFault webFault = AnnotationUtil.getPrivClassAnnotation(cls, WebFault.class);
        assertEquals("http://www.w3.org/2001/XMLSchema", webFault.targetNamespace());

    }

    @Test
    public void testWsdlWithInvalidSchema() {
View Full Code Here

        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

        env.put(ToolConstants.CFG_SERVICENAME, "HelloWorldService");
        processor.setContext(env);
        processor.execute();
        Class cls = classLoader.loadClass("org.apache.cxf.hello_world_jms.BadRecordLitFault");
        WebFault webFault = AnnotationUtil.getPrivClassAnnotation(cls, WebFault.class);
        assertEquals("http://www.w3.org/2001/XMLSchema", webFault.targetNamespace());

    }

    @Test
    public void testWsdlWithInvalidSchema() {
View Full Code Here

                            // t has a JAX-WS WebFault annotation, which describes
                            // in detail the Web Service Fault that should be thrown. Add the
                            // detail.
                            Element detail = fault.getOrCreateDetail();
                            Element faultDetails = detail.getOwnerDocument()
                                .createElementNS(faultAnnotation.targetNamespace(), faultAnnotation.name());
                            detail.appendChild(faultDetails);
                        }

                        throw fault;
                    }
View Full Code Here

    private void addExceptions(Method method) {
        Class<?>[] exTypes = method.getExceptionTypes();
        for (Class<?> exType : exTypes) {
            WebFault webFault = exType.getAnnotation(WebFault.class);
            if (webFault != null) {
                QName faultName = new QName(webFault.targetNamespace(), webFault.name());
                faultNameToException.put(faultName, (Class<? extends Exception>) exType);
            }
        }
    }
View Full Code Here

        env.put(ToolConstants.CFG_SERVICENAME, "HelloWorldService");
        processor.setContext(env);
        processor.execute();
        Class cls = classLoader.loadClass("org.apache.cxf.w2j.hello_world_jms.BadRecordLitFault");
        WebFault webFault = AnnotationUtil.getPrivClassAnnotation(cls, WebFault.class);
        assertEquals("http://www.w3.org/2001/XMLSchema", webFault.targetNamespace());

    }

    @Test
    public void testWsdlWithInvalidSchema() {
View Full Code Here

    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

                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

        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.