Examples of Fault


Examples of org.apache.cxf.interceptor.Fault

            Element token = assertion.toDOM(doc);
            message.setContextualProperty(SAMLConstants.SAML_TOKEN_ELEMENT, token);
        } catch (WSSecurityException ex) {
            StringWriter sw = new StringWriter();
            ex.printStackTrace(new PrintWriter(sw));
            throw new Fault(new RuntimeException(ex.getMessage() + ", stacktrace: " + sw.toString()));
        }
       
    }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

   
    protected DataWriter<XMLStreamWriter> getDataWriter(Message message) {
        Service service = ServiceModelUtil.getService(message.getExchange());
        DataWriter<XMLStreamWriter> dataWriter = service.getDataBinding().createWriter(XMLStreamWriter.class);
        if (dataWriter == null) {
            throw new Fault(new org.apache.cxf.common.i18n.Message("NO_DATAWRITER", BUNDLE, service
                .getName()));
        }
        dataWriter.setAttachments(message.getAttachments());
        setDataWriterValidation(service, message, dataWriter);
        return dataWriter;
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

            StaxUtils.copy(xReader, cachedOS);
            InputStream transformedIS = XSLTUtils.transform(getXSLTTemplate(), cachedOS.getInputStream());
            XMLStreamReader transformedReader = StaxUtils.createXMLStreamReader(transformedIS);
            message.setContent(XMLStreamReader.class, transformedReader);
        } catch (XMLStreamException e) {
            throw new Fault("STAX_COPY", LOG, e, e.getMessage());
        } catch (IOException e) {
            throw new Fault("GET_CACHED_INPUT_STREAM", LOG, e, e.getMessage());
        } finally {
            StaxUtils.close(xReader);
            try {
                cachedOS.close();
            } catch (IOException e) {
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

                for (Attachment a : atts) {
                    if (a.getDataHandler().getDataSource() instanceof AttachmentDataSource) {
                        try {
                            ((AttachmentDataSource)a.getDataHandler().getDataSource()).cache(message);
                        } catch (IOException e) {
                            throw new Fault(e);
                        }
                    }
                    AttachmentPart ap = soapMessage.createAttachmentPart(a.getDataHandler());
                    Iterator<String> i = a.getHeaderNames();
                    while (i != null && i.hasNext()) {
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

        } catch (JAXBException ex) {
            if (ex instanceof javax.xml.bind.MarshalException) {
                javax.xml.bind.MarshalException marshalEx = (javax.xml.bind.MarshalException)ex;
                Message faultMessage = new Message("MARSHAL_ERROR", LOG, marshalEx.getLinkedException()
                    .getMessage());
                throw new Fault(faultMessage, ex);
            } else {
                throw new Fault(new Message("MARSHAL_ERROR", LOG, ex.getMessage()), ex);
            }
        }
        return marshaller;
    }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

            }
            if (o != null && action.equals(o.toString())) {
                return;
            }
           
            throw new Fault("SOAP_ACTION_MISMATCH", LOG, null, action);
        }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

                    return retVal;
                }
            }
            return dom == null ? read(input) : new DOMSource(dom);
        } catch (IOException e) {
            throw new Fault("COULD_NOT_READ_XML_STREAM", LOG, e);
        } catch (XMLStreamException e) {
            throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
                            e.getClass().getCanonicalName(), e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

                    reader.next();
                }
                return new DOMSource(document);
            }
        } catch (XMLStreamException e) {
            throw new Fault("COULD_NOT_READ_XML_STREAM_CAUSED_BY", LOG, e,
                            e.getClass().getCanonicalName(), e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

            Transformer trans = xsltTemplate.newTransformer();
            trans.transform(beforeSource, new StreamResult(out));

            return out.getInputStream();
        } catch (IOException e) {
            throw new Fault("GET_CACHED_INPUT_STREAM", LOG, e, e.getMessage());
        } catch (TransformerException e) {
            throw new Fault("XML_TRANSFORM", LOG, e, e.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.cxf.interceptor.Fault

            Transformer trans = xsltTemplate.newTransformer();
            trans.transform(beforeSource, new StreamResult(outWriter));

            return outWriter.getReader();
        } catch (IOException e) {
            throw new Fault("GET_CACHED_INPUT_STREAM", LOG, e, e.getMessage());
        } catch (TransformerException e) {
            throw new Fault("XML_TRANSFORM", LOG, e, e.getMessage());
        }
    }
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.