Package org.codehaus.xfire.util.jdom

Examples of org.codehaus.xfire.util.jdom.StaxSerializer


                    try {
                        Method mth = exceptions[i].getMethod("getFaultInfo");
                        Class<?> infoClass = mth.getReturnType();
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(baos);
                        new StaxSerializer().writeElement(detail, writer);
                        writer.close();
                        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                        JAXBElement<?> obj = JAXBContext.newInstance(infoClass).createUnmarshaller()
                                .unmarshal(new StreamSource(bais), infoClass);
                        Constructor<?> cst = exceptions[i].getConstructor(String.class, infoClass);
View Full Code Here


    public void writeMessage(OutMessage message, XMLStreamWriter writer, MessageContext context) throws XFireFault {
        try {
            XFireFault fault = (XFireFault) message.getBody();
            if (fault.hasDetails()) {
                Element detail = fault.getDetail();
                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getContent();
                for (int i = 0; i < details.size(); i++) {
                    serializer.writeElement((Element) details.get(i), writer);
                }
            } else {
                writer.writeStartElement("stack");
                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
View Full Code Here

            writer.writeCharacters(fault.getMessage());
            writer.writeEndElement(); // message
            if (fault.hasDetails()) {
                Element detail = fault.getDetail();
                writer.writeStartElement("detail");
                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getContent();
                for (int i = 0; i < details.size(); i++) {
                    serializer.writeElement((Element) details.get(i), writer);
                }
                writer.writeEndElement(); // detail
            }
            if (configuration.isPrintStackTraceInFaults()) {
                writer.writeStartElement("stack");
View Full Code Here

                    try {
                        Method mth = exceptions[i].getMethod("getFaultInfo");
                        Class<?> infoClass = mth.getReturnType();
                        ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(baos);
                        new StaxSerializer().writeElement(detail, writer);
                        writer.close();
                        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                        JAXBElement<?> obj = JAXBContext.newInstance(infoClass).createUnmarshaller().unmarshal(new StreamSource(bais), infoClass);
                        Constructor<?> cst = exceptions[i].getConstructor(String.class, infoClass);
                        Exception e = (Exception) cst.newInstance(xfireFault.toString(), obj.getValue());
View Full Code Here

       
        try
        {
            if (value instanceof Element)
            {
                StaxSerializer serializer = new StaxSerializer();
                serializer.writeElement((Element) value, writer);
            }
            else if (value instanceof XMLStreamReader)
            {
                XMLStreamReader xsr = (XMLStreamReader) value;
                STAXUtils.copy(xsr, writer);
View Full Code Here

            {
                Element detail = fault.getDetail();

                writer.writeStartElement("detail");
               
                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getContent();
                for (int i = 0; i < details.size(); i++)
                {
                    serializer.writeElement((Element) details.get(i), writer);
                }

                writer.writeEndElement(); // Details
            }
View Full Code Here

            {
                Element detail = fault.getDetail();

                writer.writeStartElement("soap:Detail");

                StaxSerializer serializer = new StaxSerializer();
                List details = detail.getChildren();
                for (int i = 0; i < details.size(); i++)
                {
                    serializer.writeElement((Element) details.get(i), writer);
                }

                writer.writeEndElement(); // Details
            }
View Full Code Here

    }

    protected void writeHeaders(AbstractMessage msg, XMLStreamWriter writer)
            throws XMLStreamException
    {
        StaxSerializer ser = new StaxSerializer();

        List elements = msg.getHeader().getChildren();
        for (int i = 0; i < elements.size(); i++)
        {
            Element e = (Element) elements.get(i);
           
            ser.writeElement(e, writer);
        }
    }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.util.jdom.StaxSerializer

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.