Examples of XMLFault


Examples of org.objectweb.celtix.bus.bindings.xml.XMLFault

    public XMLFaultReader(JAXBDataBindingCallback cb) {
        callback = cb;
    }

    public Object read(QName name, int idx, T input) {
        XMLFault fault = (XMLFault)input;
        if (fault.getFaultDetail() != null) {
            NodeList list = fault.getFaultDetail().getChildNodes();

            QName faultName;
            for (int i = 0; i < list.getLength(); i++) {
                Node entry = list.item(i);
                if (entry.getNodeType() != Node.ELEMENT_NODE) {
                    continue;
                }
               
                faultName = new QName(entry.getNamespaceURI(),
                                      entry.getLocalName());
       
                Class<?> clazz = callback.getWebFault(faultName);
                try {
                    if (clazz != null) {
                        Class<?> faultInfo = clazz.getMethod("getFaultInfo").getReturnType();
                        Object obj = JAXBEncoderDecoder.unmarshall(callback.getJAXBContext(),
                                                                   callback.getSchema(),
                                                                   entry,
                                                                   faultName,
                                                                   faultInfo);
                        Constructor<?> ctor = clazz.getConstructor(String.class,
                                                                   obj.getClass());
                        return ctor.newInstance(fault.getFaultString(), obj);
                    }
                } catch (Exception ex) {
                    throw new WebServiceException("error in unmarshal of XMLFault", ex);
                }
            }
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.