Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultDetail


    protected void putExceptionToSOAPFault(Exception e) throws SOAPProcessingException {
        StringWriter sw = new StringWriter();
        e.printStackTrace(new PrintWriter(sw));
        sw.flush();
        SOAPFaultDetail detail = getDetail();
        if (getDetail() == null) {
            detail = getNewSOAPFaultDetail(this);
            setDetail(detail);
        }
        OMElement faultDetailEnty = new OMElementImpl(
View Full Code Here


        SOAPFaultRole faultRole = getRole();
        if (faultRole != null && faultRole.getText() != null && !"".equals(faultRole.getText())) {
            ((OMNodeEx) faultRole).serialize(writer);
        }

        SOAPFaultDetail faultDetail = getDetail();
        if (faultDetail != null) {
            ((OMNodeEx) faultDetail).serialize(writer);
        }

        OMSerializerUtil.serializeEndpart(writer);
View Full Code Here

        setNewElement(getDetail(), detail);
    }

    /** If exception detailElement is not there we will return null */
    public Exception getException() throws OMException {
        SOAPFaultDetail detail = getDetail();
        if (detail == null) {
            return null;
        }

        OMElement exceptionElement = getDetail().getFirstChildWithName(
View Full Code Here

        SOAPFaultRole faultRole = getRole();
        if (faultRole != null) {
            (faultRole).serialize(writer);
        }

        SOAPFaultDetail faultDetail = getDetail();
        if (faultDetail != null) {
            (faultDetail).serialize(writer);
        }

        OMSerializerUtil.serializeEndpart(writer);
View Full Code Here

        return elmtName.getLocalPart();
    }

    public Fault parseSoapFault(Element odeMsgEl, SOAPEnvelope envelope, Operation operation) throws AxisFault {
        SOAPFault flt = envelope.getBody().getFault();
        SOAPFaultDetail detail = flt.getDetail();
        Fault fdef = inferFault(operation, flt);
        if (fdef == null)
            return null;

        Part pdef = (Part)fdef.getMessage().getParts().values().iterator().next();
        Element partel = odeMsgEl.getOwnerDocument().createElementNS(null,pdef.getName());
        odeMsgEl.appendChild(partel);

        if (detail.getFirstChildWithName(pdef.getElementName()) != null) {
            partel.appendChild(odeMsgEl.getOwnerDocument().importNode(
                    OMUtils.toDOM(detail.getFirstChildWithName(pdef.getElementName())), true));
        } else {
            partel.appendChild(odeMsgEl.getOwnerDocument().importNode(OMUtils.toDOM(detail),true));
        }

        return fdef;
View Full Code Here

        SOAPFault fault = soapFactory.createSOAPFault();
        SOAPFaultCode code = soapFactory.createSOAPFaultCode(fault);
        code.setText(new QName(Namespaces.SOAP_ENV_NS, "Server"));
        SOAPFaultReason reason = soapFactory.createSOAPFaultReason(fault);
        reason.setText(faultName);
        SOAPFaultDetail soapDetail = soapFactory.createSOAPFaultDetail(fault);
        if (detail != null)
            soapDetail.addDetailEntry(detail);
        return fault;
    }
View Full Code Here

            message.getBody().getFault().setCode(soapFaultCode);
            return message;
        } else {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
            SOAPEnvelope message = soapFactory.getDefaultFaultEnvelope();
            SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail();
            soapFaultDetail.setText(detail);
            message.getBody().getFault().setDetail(soapFaultDetail);
            SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason();
            SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText();
            soapFaultText.setText(reason);
            soapFaultReason.addSOAPText(soapFaultText);
View Full Code Here

            message.getBody().getFault().setCode(soapFaultCode);
            return message;
        } else {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
            SOAPEnvelope message = soapFactory.getDefaultFaultEnvelope();
            SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail();
            soapFaultDetail.setText(detail);
            message.getBody().getFault().setDetail(soapFaultDetail);
            SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason();
            SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText();
            soapFaultText.setText(reason);
            soapFaultReason.addSOAPText(soapFaultText);
View Full Code Here

                                       WSTransferConstants.FAULT_INVALID_REPRESENTATION,
                                       WSTransferConstants.ATTR_WXF);

        if (!messageContext.isSOAP11()) {
            SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
            SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail();

            OMElement faultDetailElement = factory.createOMElement(WSTransferConstants.FAULT_DATAIL, WSTransferConstants.NS_URI_WSMAN,WSTransferConstants.ATTR_WSMA);
            faultDetailElement.setText(detail);

            soapFaultDetail.addChild(faultDetailElement);
            messageContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, soapFaultDetail);
        }

        triggerAxisFault(messageContext, WSTransferConstants.INVALID_REPRESENTATION_DETAIL, detail , faultCode, faultSubcode, WSTransferConstants.FAULT_INVALID_REPRESENTATION_REASON);
View Full Code Here

            messageContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, faultReason);
           
            String detail = wste.getDetail();
            if (detail != null) {
               
                SOAPFaultDetail faultDetail = fac.createSOAPFaultDetail();
                faultDetail.setText(detail);
                messageContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, faultDetail);   
            }
        }
       
        throw AxisFault.makeFault(wste);          
View Full Code Here

TOP

Related Classes of org.apache.axiom.soap.SOAPFaultDetail

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.