Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultReason


                                try {
                                    SOAPFault fault = factory.createSOAPFault(body);
                                    SOAPFaultCode code = factory.createSOAPFaultCode(fault);
                                    SOAPFaultValue value = factory.createSOAPFaultValue(code);
                                    value.setText("env:MustUnderstand");
                                    SOAPFaultReason reason = factory.createSOAPFaultReason(fault);
                                    SOAPFaultText text = factory.createSOAPFaultText(reason);
                                    text.setLang("en-US");
                                    text.setText("Header not understood");
                                    reason.addSOAPText(text);
                                    //fault.setReason(reason);
                                    if (roleValue != null && roleValue.equals(SAMPLE_ROLE + "/" + ROLE_BY_B)) {
                                        SOAPFaultNode node = factory.createSOAPFaultNode(fault);
                                        node.setNodeValue(SAMPLE_ROLE + "/" + ROLE_BY_B);
                                        SOAPFaultRole role = factory.createSOAPFaultRole(fault);
View Full Code Here


        defaultsSet = true;
    }
   
    void removeDefaults() {
        if (defaultsSet) {
            SOAPFaultReason reason = this.fault.getReason();
            if (reason != null) {
                reason.detach();
            }
            defaultsSet = false;
        }
    }
View Full Code Here

     * @see getFaultString()
     */

    public void setFaultString(String faultString, Locale locale) throws SOAPException {
        if (this.fault.getReason() != null) {
            SOAPFaultReason reason = this.fault.getReason();
            if (this.element.getOMFactory() instanceof SOAP11Factory) {
                reason.setText(faultString);
            } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
                addFaultReasonText(faultString, locale);
            }
        } else {
            if (this.element.getOMFactory() instanceof SOAP11Factory) {
                SOAPFaultReason reason = new SOAP11FaultReasonImpl(this.fault,
                                                                   (SOAPFactory)this.element
                                                                           .getOMFactory());
                reason.setText(faultString);
            } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
                addFaultReasonText(faultString, locale);
            }
        }
        this.faultReasonLocale = locale;
View Full Code Here

            String existingReasonText = getFaultReasonText(locale);
            if (existingReasonText == null) {
                org.apache.axiom.soap.SOAPFactory soapFactory = null;
                soapFactory = (SOAP12Factory)this.element.getOMFactory();
                if (this.fault.getReason() == null) {
                    SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason(this.fault);
                    this.fault.setReason(soapFaultReason);
                }
                SOAPFaultText soapFaultText =
                        soapFactory.createSOAPFaultText(this.fault.getReason());
                soapFaultText.setText(text);
View Full Code Here

        if (this.element.getOMFactory() instanceof SOAP11Factory) {
            throw new UnsupportedOperationException("Message does not support the " +
                    "SOAP 1.2 concept of Fault Reason");
        } else {
            Iterator soapTextsItr = null;
            SOAPFaultReason soapFaultReason = this.fault.getReason();
            if (soapFaultReason != null) {
                List soapTexts = soapFaultReason.getAllSoapTexts();
                if (soapTexts != null) {
                    soapTextsItr = soapTexts.iterator();
                    while (soapTextsItr.hasNext()) {
                        SOAPFaultText soapFaultText = (SOAPFaultText)soapTextsItr.next();
                        if (soapFaultText.getLang().equals(locale.toString())) {
View Full Code Here

        }
        XMLFaultCode code = XMLFaultCode.fromQName(codeQName);

        // Get the primary reason text
        // TODO what if this fails
        SOAPFaultReason soapReason = soapFault.getReason();
        String text = null;
        String lang = null;
        List soapTexts = null;
        if (isSoap11) {
            text = soapReason.getText();
        } else {
            soapTexts = soapReason.getAllSoapTexts();
            SOAPFaultText reasonText = (SOAPFaultText)soapTexts.get(0);
            text = reasonText.getText();
            lang = reasonText.getLang();
        }
        XMLFaultReason reason = new XMLFaultReason(text, lang);
View Full Code Here

            SOAPFaultValue soapValue = factory.createSOAPFaultValue(soapCode);
            soapValue.setText(soapValueQName);
        }

        // Set the primary Reason Text
        SOAPFaultReason soapReason = factory.createSOAPFaultReason(soapFault);
        if (isSoap11) {
            soapReason.setText(xmlFault.getReason().getText());
        } else {
            SOAPFaultText soapText = factory.createSOAPFaultText(soapReason);
            soapText.setText(xmlFault.getReason().getText());
            soapText.setLang(xmlFault.getReason().getLang());
        }
View Full Code Here

            } else {
                SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
                soapFaultValue.setText(M_FAULT_EXCEPTION);
            }

            SOAPFaultReason soapFaultReason = soapFac.createSOAPFaultReason();

            if (msgContext.isSOAP11()) {
                soapFaultReason.setText(FAULT_REASON);
            } else {
                SOAPFaultText soapFaultText = soapFac.createSOAPFaultText();
                soapFaultText.setLang("en");
                soapFaultText.setText(FAULT_REASON);
                soapFaultReason.addSOAPText(soapFaultText);
            }

            SOAPFaultDetail faultDetail = soapFac.createSOAPFaultDetail();
            faultDetail.addDetailEntry(detailEntry);
View Full Code Here

        SOAPFaultValue soapFaultValue = soapFactory
                .createSOAPFaultValue(soapFaultCode);
        soapFaultValue.setText(new QName(
                SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "Sender"));

        SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason();
        SOAPFaultText soapFaultText = soapFactory
                .createSOAPFaultText(soapFaultReason);
        soapFaultText.setText(REASON);

        SOAPFaultDetail soapFaultDetail = soapFactory.createSOAPFaultDetail();
View Full Code Here

                                newSOAPFaultValue.setText(value);
                            }

                        }

                        SOAPFaultReason reason = soapFault.getReason();
                        if(reason != null) {
                            SOAPFaultReason newSOAPFaultReason
                                = soap12Factory.createSOAPFaultReason(newSOAPFault);
                            String reasonText = reason.getText();
                            if(reasonText != null) {
                                SOAPFaultText newSOAPFaultText
                                    = soap12Factory.createSOAPFaultText(newSOAPFaultReason);
View Full Code Here

TOP

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

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.