Package org.apache.servicemix.cxf.binding.nmr

Examples of org.apache.servicemix.cxf.binding.nmr.NMRFault


       
       
        try {
            XMLStreamWriter writer = getWriter(message);
            Fault fault = getFault(message);
            NMRFault jbiFault = NMRFault.createFault(fault);
            nsStack.add(NMRConstants.NS_NMR_BINDING);
            String prefix = nsStack.getPrefix(NMRConstants.NS_NMR_BINDING);
            StaxUtils.writeStartElement(writer, prefix, NMRFault.NMR_FAULT_ROOT,
                                        NMRConstants.NS_NMR_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("ILLEGAL_JBIFAULT_FORMAT", BUNDLE));
            }
            Fault fault = new NMRFault(new org.apache.cxf.common.i18n.Message(NMRFault.NMR_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.servicemix.cxf.binding.nmr.NMRFault

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.