Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultValue


            soapFaultCode = soapFactory.createSOAPFaultCode(fault);
            soapFaultCode.setText(faultCode);
        } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
            soapFactory = (SOAP12Factory)this.element.getOMFactory();
            soapFaultCode = soapFactory.createSOAPFaultCode(fault);
            SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode);
            soapFaultCode.setValue(soapFaultValue);
            soapFaultValue.setText(faultCode);
        }

        this.fault.setCode(soapFaultCode);
    }
View Full Code Here


            soapFaultCode.setText(prefix + ":" + qname.getLocalPart());
            OMNamespace omNamespace = new OMNamespaceImpl(qname.getNamespaceURI(),
                                                          qname.getPrefix());
            soapFaultCode.declareNamespace(omNamespace);
        } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
            SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode);
            // don't just use the default prefix, use the passed one or the parent's
            soapFaultValue.setText(prefix + ":" + qname.getLocalPart());
            OMNamespace omNamespace = new OMNamespaceImpl(qname.getNamespaceURI(),
                                                          qname.getPrefix());
            soapFaultValue.declareNamespace(omNamespace);
            soapFaultCode.setValue(soapFaultValue);
        }
       
        this.fault.setCode(soapFaultCode);
    }
View Full Code Here

        if (soapSubCode != null) {
            List<QName> list = new ArrayList<QName>();

            // Walk the nested sub codes and collect the qnames
            while (soapSubCode != null) {
                SOAPFaultValue soapSubCodeValue = soapSubCode.getValue();
                QName qName = soapSubCodeValue.getTextAsQName();
                list.add(qName);
                soapSubCode = soapSubCode.getSubCode();
            }

            // Put the collected sub code qnames onto the xmlFault
View Full Code Here

        SOAPFaultCode soapCode = factory.createSOAPFaultCode(soapFault);
        QName soapValueQName = xmlFault.getCode().toQName(ns.getNamespaceURI());
        if (isSoap11) {
            soapCode.setText(soapValueQName);
        } else {
            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());
        }

        // Set the Detail and contents of Detail
        Block[] blocks = xmlFault.getDetailBlocks();
        if (blocks != null && blocks.length > 0) {
            SOAPFaultDetail detail = factory.createSOAPFaultDetail(soapFault);
            if (!ignoreDetailBlocks) {
                for (int i = 0; i < blocks.length; i++) {
                    // A Block implements OMDataSource.  So create OMSourcedElements
                    // for each of the Blocks.
                    OMSourcedElementImpl element =
                            new OMSourcedElementImpl(blocks[i].getQName(), factory, blocks[i]);
                    detail.addChild(element);
                }
            }
        }

        // Now set all of the secondary fault information
        // Set the SubCodes
        QName[] subCodes = xmlFault.getSubCodes();
        if (subCodes != null && subCodes.length > 0) {
            OMElement curr = soapCode;
            for (int i = 0; i < subCodes.length; i++) {
                SOAPFaultSubCode subCode = (i == 0) ?
                        factory.createSOAPFaultSubCode((SOAPFaultCode)curr) :
                        factory.createSOAPFaultSubCode((SOAPFaultSubCode)curr);
                SOAPFaultValue soapSubCodeValue = factory.createSOAPFaultValue(subCode);
                soapSubCodeValue.setText(subCodes[i]);
                curr = subCode;
            }
        }

        // Set the secondary reasons and languages
View Full Code Here

        SOAPFactory soapFac = OMAbstractFactory.getSOAP12Factory();
        SOAPFaultCode soapFaultCode = soapFac.createSOAPFaultCode();
        if (messageContext.isSOAP11()) {
            soapFaultCode.setText(faultCode);
        } else {
            SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
            soapFaultValue.setText(SOAP12Constants.SOAP_DEFAULT_NAMESPACE_PREFIX + ":" +
                    SOAP12Constants.FAULT_CODE_SENDER);
            SOAPFaultSubCode soapFaultSubCode = soapFac.createSOAPFaultSubCode(soapFaultCode);
            SOAPFaultValue soapFaultSubcodeValue = soapFac.createSOAPFaultValue(soapFaultSubCode);
            soapFaultSubcodeValue.setText(AddressingConstants.WSA_DEFAULT_PREFIX + ":" + faultCode);
            if (faultSubCode != null) {
                SOAPFaultSubCode soapFaultSubCode2 =
                        soapFac.createSOAPFaultSubCode(soapFaultSubCode);
                SOAPFaultValue soapFaultSubcodeValue2 =
                        soapFac.createSOAPFaultValue(soapFaultSubCode2);
                soapFaultSubcodeValue2
                        .setText(AddressingConstants.WSA_DEFAULT_PREFIX + ":" + faultSubCode);
            }
        }
        messageContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, soapFaultCode);
    }
View Full Code Here

            SOAPFaultCode soapFaultCode = soapFac.createSOAPFaultCode();
            soapFaultCode.declareNamespace("http://someuri.org", "m");
            if (msgContext.isSOAP11()) {
                soapFaultCode.setText(M_FAULT_EXCEPTION);
            } else {
                SOAPFaultValue soapFaultValue = soapFac.createSOAPFaultValue(soapFaultCode);
                soapFaultValue.setText(M_FAULT_EXCEPTION);
            }

            SOAPFaultReason soapFaultReason = soapFac.createSOAPFaultReason();

            if (msgContext.isSOAP11()) {
View Full Code Here

        } else {
            soapFactory = OMAbstractFactory.getSOAP12Factory();
        }

        soapFaultCode = soapFactory.createSOAPFaultCode();
        SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode);
        soapFaultValue.setText(new QName("http://test.org", "TestFault", "test"));

        soapFaultReason = soapFactory.createSOAPFaultReason();
        SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText(soapFaultReason);
        soapFaultText.setText("This is some FaultReason");
View Full Code Here

    public void testFaultSerialization() throws Exception {
        final String REASON = "ReasonValue";

        SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
        SOAPFaultCode soapFaultCode = soapFactory.createSOAPFaultCode();
        SOAPFaultValue soapFaultValue = soapFactory
                .createSOAPFaultValue(soapFaultCode);
        soapFaultValue.setText(new QName(
                SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "Sender"));

        SOAPFaultReason soapFaultReason = soapFactory.createSOAPFaultReason();
        SOAPFaultText soapFaultText = soapFactory
                .createSOAPFaultText(soapFaultReason);
View Full Code Here

                            SOAPFaultCode newSOAPFaultCode = soap12Factory.createSOAPFaultCode();
                            newSOAPFault.setCode(newSOAPFaultCode);

                            String value = code.getText();
                            if(value != null) {
                                SOAPFaultValue newSOAPFaultValue
                                    = soap12Factory.createSOAPFaultValue(newSOAPFaultCode);
                                newSOAPFaultValue.setText(value);
                            }

                        }

                        SOAPFaultReason reason = soapFault.getReason();
View Full Code Here

                        SOAPFaultCode code = soapFault.getCode();
                        if(code != null) {
                            SOAPFaultCode newSOAPFaultCode
                                = soap11Factory.createSOAPFaultCode(newSOAPFault);

                            SOAPFaultValue value = code.getValue();
                            if(value != null) {
                                soap11Factory.createSOAPFaultValue(newSOAPFaultCode);
                                if(value.getText() != null) {
                                    newSOAPFaultCode.setText(value.getText());
                                }
                            }
                        }

                        SOAPFaultReason reason = soapFault.getReason();
View Full Code Here

TOP

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

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.