Package org.apache.cxf.binding.jbi

Examples of org.apache.cxf.binding.jbi.JBIFault


            if (exchange.getStatus() == ExchangeStatus.ERROR) {
                throw new Fault(exchange.getError());
            }
            if (!ex.isOneWay()) {
                if (exchange.getFault() != null) {
                    Fault f = new JBIFault(new org.apache.cxf.common.i18n.Message(
                            "Fault occured", (ResourceBundle) null));

                    Element details = toElement(exchange.getFault().getContent());
                    f.setDetail(details);
                    processFaultDetail(f, message);
                    message.put(BindingFaultInfo.class, faultWanted);
                    throw f;
                } else if (exchange.getMessage("out") != null) {
                    Endpoint endpoint = ex.get(Endpoint.class);
View Full Code Here


            }
            if (!ex.isOneWay()) {
                if (exchange.getFault() != null) {
                    Fault f = null;
                    if (isUseJBIWrapper()) {
                        f = new JBIFault(
                                new org.apache.cxf.common.i18n.Message(
                                        "Fault occured", (ResourceBundle) null));
                        if (exchange.getProperty("faultstring") != null) {
                            f.setMessage((String)exchange.getProperty("faultstring"));
                        } else {
View Full Code Here

       
       
        try {
            XMLStreamWriter writer = getWriter(message);
            Fault fault = getFault(message);
            JBIFault jbiFault = JBIFault.createFault(fault);
            nsStack.add(JBIConstants.NS_JBI_BINDING);
            String prefix = nsStack.getPrefix(JBIConstants.NS_JBI_BINDING);
            StaxUtils.writeStartElement(writer, prefix, JBIFault.JBI_FAULT_ROOT,
                                        JBIConstants.NS_JBI_BINDING);
            if (!jbiFault.hasDetails()) {
                writer.writeEmptyElement("fault");
            } else {
                Element detail = jbiFault.getDetail();
                NodeList details = detail.getChildNodes();
                for (int i = 0; i < details.getLength(); i++) {
                    if (details.item(i) instanceof Element) {
                        StaxUtils.writeNode(details.item(i), writer, true);
                        break;
View Full Code Here

            }
            if (!ex.isOneWay()) {
                if (exchange.getFault() != null) {
                    Fault f = null;
                    if (isUseJBIWrapper()) {
                        f = new JBIFault(
                                new org.apache.cxf.common.i18n.Message(
                                        "Fault occured", (ResourceBundle) null));
                        Element details = toElement(exchange.getFault()
                                .getContent());
                        f.setDetail(details);
View Full Code Here

       
       
        try {
            XMLStreamWriter writer = getWriter(message);
            Fault fault = getFault(message);
            JBIFault jbiFault = JBIFault.createFault(fault);
            nsStack.add(JBIConstants.NS_JBI_BINDING);
            String prefix = nsStack.getPrefix(JBIConstants.NS_JBI_BINDING);
            StaxUtils.writeStartElement(writer, prefix, JBIFault.JBI_FAULT_ROOT,
                                        JBIConstants.NS_JBI_BINDING);
            if (!jbiFault.hasDetails()) {
                writer.writeEmptyElement("fault");
            } else {
                Element detail = jbiFault.getDetail();
                Element elem = DOMUtils.getFirstElement(detail);
                if (elem != null) {
                    StaxUtils.writeNode(elem, writer, true);   
                }             
            }
View Full Code Here

        try {           
           
            if (!StaxUtils.toNextElement(reader)) {
                throw new Fault(new org.apache.cxf.common.i18n.Message("ILLEGAL_JBIFAULT_FORMAT", BUNDLE));
            }
            Fault fault = new JBIFault(new org.apache.cxf.common.i18n.Message(JBIFault.JBI_FAULT_STRING,
                                                                              (ResourceBundle) null));
           
            if (StaxUtils.toNextElement(reader)) {
                // handling detail
                Element detail = StaxUtils.read(new FragmentStreamReader(reader)).getDocumentElement();
                fault.setDetail(detail);
            }
            message.setContent(Exception.class, fault);
        } catch (XMLStreamException xse) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_READ_EXC", BUNDLE));
        }
View Full Code Here

       
       
        try {
            XMLStreamWriter writer = getWriter(message);
            Fault fault = getFault(message);
            JBIFault jbiFault = JBIFault.createFault(fault);
            nsStack.add(JBIConstants.NS_JBI_BINDING);
            String prefix = nsStack.getPrefix(JBIConstants.NS_JBI_BINDING);
            StaxUtils.writeStartElement(writer, prefix, JBIFault.JBI_FAULT_ROOT,
                                        JBIConstants.NS_JBI_BINDING);
            if (!jbiFault.hasDetails()) {
                Element faultString = DOMUtils.createDocument().createElement("fault");
                faultString.setTextContent(jbiFault.getCause().getMessage());
                StaxUtils.writeNode(faultString, writer, true);  
            } else {
                Element detail = jbiFault.getDetail();
                Element elem = DOMUtils.getFirstElement(detail);
                if (elem != null) {
                    StaxUtils.writeNode(elem, writer, true);   
                }             
            }
View Full Code Here

       
       
        try {
            XMLStreamWriter writer = getWriter(message);
            Fault fault = getFault(message);
            JBIFault jbiFault = JBIFault.createFault(fault);
            nsStack.add(JBIConstants.NS_JBI_BINDING);
            String prefix = nsStack.getPrefix(JBIConstants.NS_JBI_BINDING);
            StaxUtils.writeStartElement(writer, prefix, JBIFault.JBI_FAULT_ROOT,
                                        JBIConstants.NS_JBI_BINDING);
            if (!jbiFault.hasDetails()) {
                writer.writeEmptyElement("fault");
            } else {
                Element detail = jbiFault.getDetail();
                NodeList details = detail.getChildNodes();
                for (int i = 0; i < details.getLength(); i++) {
                    if (details.item(i) instanceof Element) {
                        StaxUtils.writeNode(details.item(i), writer, true);
                        break;
View Full Code Here

        try {           
           
            if (!StaxUtils.toNextElement(reader)) {
                throw new Fault(new org.apache.cxf.common.i18n.Message("ILLEAGAL_JBIFAULT_FORMAT", BUNDLE));
            }
            Fault fault = new JBIFault(new org.apache.cxf.common.i18n.Message(JBIFault.JBI_FAULT_STRING,
                                                                              (ResourceBundle) null));
           
            if (StaxUtils.toNextElement(reader)) {
                // handling detail
                Element detail = StaxUtils.read(new FragmentStreamReader(reader)).getDocumentElement();
                fault.setDetail(detail);
            }
            message.setContent(Exception.class, fault);
        } catch (XMLStreamException xse) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("STAX_READ_EXC", BUNDLE));
        }
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.jbi.JBIFault

Copyright © 2018 www.massapicom. 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.