Package org.codehaus.xfire.fault

Examples of org.codehaus.xfire.fault.XFireFault


        {
            serializer.writeElement(doc.getRootElement(), writer);
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Couldn't write message.", e, XFireFault.RECEIVER);
        }
    }
View Full Code Here


            }

            // check max occurs
            int size = values.size();
            if (size > maxOccurs)
                throw new XFireFault("The number of elements in " + getSchemaType() +
                                     " exceeds the maximum of " + maxOccurs, XFireFault.SENDER);
           
        }

        // check min occurs
        if (values.size() < minOccurs)
            throw new XFireFault("The number of elements in " + getSchemaType() +
                                 " does not meet the minimum of " + minOccurs, XFireFault.SENDER);
        return values;
    }
View Full Code Here

            Calendar c = (Calendar) format.parseObject(value);
            return new Timestamp(c.getTimeInMillis());
        }
        catch (ParseException e)
        {
            throw new XFireFault("Could not parse xs:dateTime: " + e.getMessage(), e, XFireFault.SENDER);
        }
    }
View Full Code Here

           
            write((Source) object, ((ElementWriter) writer).getXMLStreamWriter());
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Could not write xml.", e, XFireFault.SENDER);
        }
    }
View Full Code Here

            {
                element = ((Document) ds.getNode()).getDocumentElement();
            }
            else
            {
                throw new XFireFault("Node type " + ds.getNode().getClass() +
                                     " was not understood.", XFireFault.RECEIVER);
            }
          
            STAXUtils.writeElement(element, writer, false);
        }
        else if (object instanceof SAXSource)
        {
            SAXSource source = (SAXSource) object;
     
            try
            {
                XMLReader xmlReader = source.getXMLReader();
                if (xmlReader == null)
                    xmlReader = createXMLReader();
               
                xmlReader.setContentHandler(new FilteringContentHandlerToXMLStreamWriter(writer));
               
                xmlReader.parse(source.getInputSource());
            }
            catch (Exception e)
            {
                throw new XFireFault("Could not send xml.", e, XFireFault.RECEIVER);
            }
        }
        else if (object instanceof StreamSource)
        {
            StreamSource ss = (StreamSource) object;
View Full Code Here

            XMLStreamReader reader = ((ElementReader) mreader).getXMLStreamReader();
            return STAXUtils.read(builder, new FragmentStreamReader(reader), true);
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Could not parse xml.", e, XFireFault.SENDER);
        }
    }
View Full Code Here

                                   ((ElementWriter) writer).getXMLStreamWriter(),
                                   false);
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Could not write xml.", e, XFireFault.SENDER);
        }
    }
View Full Code Here

            STAXUtils.copy(reader, ((ElementWriter) writer).getXMLStreamWriter());
            reader.close();
        }
        catch (XMLStreamException e)
        {
            throw new XFireFault("Could not write xml.", e, XFireFault.SENDER);
        }
    }
View Full Code Here

                    }
                    else
                    {
                        if (!info.isNillable(name))
                        {
                            throw new XFireFault(
                                    name.getLocalPart() + " is nil, but not nillable.",
                                    XFireFault.SENDER);

                        }
                        childReader.readToEnd();
                    }
                }
                else
                {
                    childReader.readToEnd();
                }
            }

            return object;
        }
        catch (IllegalAccessException e)
        {
            throw new XFireFault("Illegal access. " + e.getMessage(), e, XFireFault.RECEIVER);
        }
        catch (InstantiationException e)
        {
            throw new XFireFault("Couldn't instantiate class. " + e.getMessage(), e,
                    XFireFault.SENDER);
        }
        catch (SecurityException e)
        {
            throw new XFireFault("Illegal access. " + e.getMessage(), e, XFireFault.RECEIVER);
        }
        catch (IllegalArgumentException e)
        {
            throw new XFireFault("Illegal argument. " + e.getMessage(), e, XFireFault.RECEIVER);
        }
        catch (InvocationTargetException e)
        {
            throw new XFireFault("Couldn't create class: " + e.getMessage(), e, XFireFault.RECEIVER);
        }

    }
View Full Code Here

        Object body = context.getExchange().getFaultMessage().getBody();

        if (!(body instanceof XFireFault))
            return clazz.newInstance();

        XFireFault fault = (XFireFault) body;

        try
        {
            ctr = clazz.getConstructor(new Class[] { String.class, Throwable.class });
            o = ctr.newInstance(new Object[] { fault.getMessage(), fault });
        }
        catch (NoSuchMethodException e)
        {
            try
            {
                ctr = clazz.getConstructor(new Class[] { String.class, Exception.class });
                o = ctr.newInstance(new Object[] { fault.getMessage(), fault });
            }
            catch (NoSuchMethodException e1)
            {
                try
                {
                    ctr = clazz.getConstructor(new Class[] { String.class });
                    o = ctr.newInstance(new Object[] { fault.getMessage() });
                }
                catch (NoSuchMethodException e2)
                {
                    return clazz.newInstance();
                }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.fault.XFireFault

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.