Package org.apache.tuscany.sca.interfacedef.util

Examples of org.apache.tuscany.sca.interfacedef.util.FaultException


            //
            // Note this may happen even if we find a constructor above, that is the type of the non-generic fault exc may be an instance
            // of FaultException
            //
            if ((exc instanceof FaultException) && (faultBeanType.getLogical() instanceof XMLType)) {
                FaultException faultExc = (FaultException)exc;
                DataType<XMLType> faultBeanXMLType = (DataType<XMLType>)faultBeanType;
                XMLType faultLogical = faultBeanXMLType.getLogical();
                faultExc.setFaultName(faultLogical.getElementName());
            }
            return exc;
        } catch (Throwable e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here


                                ctor = exceptionClass.getConstructor();
                                if (ctor != null) {
                                    ex = ctor.newInstance();
                                    populateException(ex, faultInfo);
                                } else {
                                    ex = new FaultException(message, faultInfo, cause);
                                }
                            } catch (NoSuchMethodException e5) {
                                try {
                                    ctor = exceptionClass.getConstructor(Throwable.class);
                                    ex = ctor.newInstance(cause);
View Full Code Here

    private Message getResponseNode(String responseXML) throws IOException, SAXException {
        Message msg = messageFactory.createMessage();
        if (responseXML.startsWith("DECLAREDEXCEPTION:")) {
            Document responseDOM = domHelper.load(responseXML.substring(18));
            FaultException e = new FaultException("remote exception", responseDOM);
            Node node = ((Node)responseDOM).getFirstChild();
            e.setFaultName(new QName(node.getNamespaceURI(), node.getLocalName()));
            msg.setFaultBody(e);
        } else if (responseXML.startsWith("EXCEPTION:")) {
            throw new ServiceRuntimeException("Remote exception:" + responseXML.substring(10));
        } else {
            Document responseDOM = domHelper.load(responseXML);
View Full Code Here

            }
           
            msg.setBody(resp);
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

        SOAPFault fault = e.getFault();
        Detail detail = fault.getDetail();
        if (detail != null) {
            for (Iterator i = detail.getDetailEntries(); i.hasNext();) {
                DetailEntry entry = (DetailEntry)i.next();
                FaultException fe = new FaultException(e.getMessage(), entry, e);
                fe.setFaultName(entry.getElementQName());
                msg.setFaultBody(fe);
            }
        } else {
            msg.setFaultBody(e);
        }
View Full Code Here

            SOAPMessage response = soapMessageFactory.createMessage();
            if (responseMsg.isFault()) {
                //                ServiceRuntimeException e = responseMsg.getBody();
                //                throw e;

                FaultException fe = responseMsg.getBody();
                SOAPFault fault = response.getSOAPBody().addFault(new QName(response.getSOAPBody().getNamespaceURI(), "Server"), fe.getMessage());
                Detail d = fault.addDetail();
                DetailEntry de = d.addDetailEntry(fe.getFaultName());
                SOAPElement dece = de.addChildElement("message");
                if (fe.getMessage() != null) {
                    dece.addTextNode(fe.getMessage());
                }

            } else {
                Element element = responseMsg.getBody();
                response.getSOAPBody().addChildElement(soapFactory.createElement(element));
View Full Code Here

            //
            // Note this may happen even if we find a constructor above, that is the type of the non-generic fault exc may be an instance
            // of FaultException
            //
            if ((exc instanceof FaultException) && (faultBeanType.getLogical() instanceof XMLType)) {
                FaultException faultExc = (FaultException)exc;
                DataType<XMLType> faultBeanXMLType = (DataType<XMLType>)faultBeanType;
                XMLType faultLogical = faultBeanXMLType.getLogical();
                faultExc.setFaultName(faultLogical.getElementName());
            }
            return exc;
        } catch (Throwable e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here

                                ctor = exceptionClass.getConstructor();
                                if (ctor != null) {
                                    ex = ctor.newInstance();
                                    populateException(ex, faultInfo);
                                } else {
                                    ex = new FaultException(message, faultInfo, cause);
                                }
                            } catch (NoSuchMethodException e5) {
                                try {
                                    ctor = exceptionClass.getConstructor(Throwable.class);
                                    ex = ctor.newInstance(cause);
View Full Code Here

                }
            }
            
        } catch (AxisFault e) {
            if (e.getDetail() != null ) {
                FaultException f = new FaultException(e.getMessage(), e.getDetail(), e);
                f.setFaultName(e.getDetail().getQName());
                msg.setFaultBody(f);
            } else {
                msg.setFaultBody(e);
            }
        } catch (Throwable e) {
View Full Code Here

                if (response != null) {
                    msg.setBody(response);
                    try {
                        if (jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
                            FaultException e = new FaultException("remote exception", response);
                            xmlhelper.setFaultName(e, response);
                            msg.setFaultBody(e);
                        }
                    } catch (JMSException e) {
                        throw new JMSBindingException(e);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.util.FaultException

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.