Package mondrian.xmla

Examples of mondrian.xmla.XmlaErrorTest$Fault


            List<XMLObject> faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
            if (faults.size() < 1) {
                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

            log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
            SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
                    + " Fault Message: " + fault.getMessage().getValue());
            faultException.setFault(fault);
            throw faultException;
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
View Full Code Here


public class FaultUnmarshaller extends AbstractXMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        Fault fault = (Fault) parentXMLObject;
       
        if(childXMLObject instanceof XSQName){
            fault.setCode((FaultCode) childXMLObject);
        }else if(childXMLObject instanceof XSString){
            fault.setMessage((FaultString) childXMLObject);
        }else if(childXMLObject instanceof XSURI){
            fault.setActor((FaultActor) childXMLObject);
        }else if(childXMLObject instanceof Detail){
            fault.setDetail((Detail) childXMLObject);
        }
    }
View Full Code Here

            throw new IllegalArgumentException("Argument for 'faultstring' may not be null");
        }
       
        XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
       
        Fault faultObj =  (Fault) builderFactory.getBuilder(Fault.DEFAULT_ELEMENT_NAME)
            .buildObject(Fault.DEFAULT_ELEMENT_NAME);
        FaultCode faultCodeObj =  (FaultCode) builderFactory.getBuilder(FaultCode.DEFAULT_ELEMENT_NAME)
            .buildObject(FaultCode.DEFAULT_ELEMENT_NAME);
        FaultString faultStringObj =  (FaultString) builderFactory.getBuilder(FaultString.DEFAULT_ELEMENT_NAME)
            .buildObject(FaultString.DEFAULT_ELEMENT_NAME);
       
        faultCodeObj.setValue(faultCode);
        faultObj.setCode(faultCodeObj);
       
        faultStringObj.setValue(faultString);
        faultObj.setMessage(faultStringObj);
       
        if (faultActor != null) {
            FaultActor faultActorObj =  (FaultActor) builderFactory.getBuilder(FaultActor.DEFAULT_ELEMENT_NAME)
                .buildObject(FaultActor.DEFAULT_ELEMENT_NAME);
            faultActorObj.setValue(faultActor);
            faultObj.setActor(faultActorObj);
        }
           
        Detail detailObj = null;
        if (detailChildren != null && !detailChildren.isEmpty()) {
            detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
                .buildObject(Detail.DEFAULT_ELEMENT_NAME);
            for (XMLObject xo : detailChildren) {
                if (xo != null) {
                    detailObj.getUnknownXMLObjects().add(xo);
                }
            }
        }
        if (detailAttributes != null && !detailAttributes.isEmpty()) {
            if (detailObj == null) {
                detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
                    .buildObject(Detail.DEFAULT_ELEMENT_NAME);
            }
            for (Entry<QName,String> entry : detailAttributes.entrySet()) {
                if (entry.getKey() != null && entry.getValue() != null) {
                    detailObj.getUnknownAttributes().put(entry.getKey(), entry.getValue());
                }
            }
        }
        if (detailObj != null &&
                (!detailObj.getUnknownXMLObjects().isEmpty() || !detailObj.getUnknownAttributes().isEmpty())) {
            faultObj.setDetail(detailObj);
        }
       
        return faultObj;
    }
View Full Code Here

            List<XMLObject> faults = response.getBody().getUnknownXMLObjects(Fault.DEFAULT_ELEMENT_NAME);
            if (faults.size() < 1) {
                throw new SOAPClientException("HTTP status code was 500 but SOAP response did not contain a Fault");
            }
            Fault fault = (Fault) faults.get(0);

            log.debug("SOAP fault code {} with message {}", fault.getCode().getValue(), fault.getMessage().getValue());
            SOAPFaultException faultException = new SOAPFaultException("SOAP Fault: " + fault.getCode().getValue()
                    + " Fault Message: " + fault.getMessage().getValue());
            faultException.setFault(fault);
            throw faultException;
        } catch (IOException e) {
            throw new SOAPClientException("Unable to read response", e);
        }
View Full Code Here

public class FaultUnmarshaller extends AbstractXMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentXMLObject, XMLObject childXMLObject)
            throws UnmarshallingException {
        Fault fault = (Fault) parentXMLObject;
       
        if(childXMLObject instanceof XSQName){
            fault.setCode((FaultCode) childXMLObject);
        }else if(childXMLObject instanceof XSString){
            fault.setMessage((FaultString) childXMLObject);
        }else if(childXMLObject instanceof XSURI){
            fault.setActor((FaultActor) childXMLObject);
        }else if(childXMLObject instanceof Detail){
            fault.setDetail((Detail) childXMLObject);
        }
    }
View Full Code Here

            throw new IllegalArgumentException("Argument for 'faultstring' may not be null");
        }
       
        XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
       
        Fault faultObj =  (Fault) builderFactory.getBuilder(Fault.DEFAULT_ELEMENT_NAME)
            .buildObject(Fault.DEFAULT_ELEMENT_NAME);
        FaultCode faultCodeObj =  (FaultCode) builderFactory.getBuilder(FaultCode.DEFAULT_ELEMENT_NAME)
            .buildObject(FaultCode.DEFAULT_ELEMENT_NAME);
        FaultString faultStringObj =  (FaultString) builderFactory.getBuilder(FaultString.DEFAULT_ELEMENT_NAME)
            .buildObject(FaultString.DEFAULT_ELEMENT_NAME);
       
        faultCodeObj.setValue(faultCode);
        faultObj.setCode(faultCodeObj);
       
        faultStringObj.setValue(faultString);
        faultObj.setMessage(faultStringObj);
       
        if (faultActor != null) {
            FaultActor faultActorObj =  (FaultActor) builderFactory.getBuilder(FaultActor.DEFAULT_ELEMENT_NAME)
                .buildObject(FaultActor.DEFAULT_ELEMENT_NAME);
            faultActorObj.setValue(faultActor);
            faultObj.setActor(faultActorObj);
        }
           
        Detail detailObj = null;
        if (detailChildren != null && !detailChildren.isEmpty()) {
            detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
                .buildObject(Detail.DEFAULT_ELEMENT_NAME);
            for (XMLObject xo : detailChildren) {
                if (xo != null) {
                    detailObj.getUnknownXMLObjects().add(xo);
                }
            }
        }
        if (detailAttributes != null && !detailAttributes.isEmpty()) {
            if (detailObj == null) {
                detailObj = (Detail) builderFactory.getBuilder(Detail.DEFAULT_ELEMENT_NAME)
                    .buildObject(Detail.DEFAULT_ELEMENT_NAME);
            }
            for (Entry<QName,String> entry : detailAttributes.entrySet()) {
                if (entry.getKey() != null && entry.getValue() != null) {
                    detailObj.getUnknownAttributes().put(entry.getKey(), entry.getValue());
                }
            }
        }
        if (detailObj != null &&
                (!detailObj.getUnknownXMLObjects().isEmpty() || !detailObj.getUnknownAttributes().isEmpty())) {
            faultObj.setDetail(detailObj);
        }
       
        return faultObj;
    }
View Full Code Here

TOP

Related Classes of mondrian.xmla.XmlaErrorTest$Fault

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.