Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultValue


                                              QName faultCode, QName faultSubcode) throws AxisFault {

        SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();

        SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode();
        SOAPFaultValue soapFaultValue = factory.createSOAPFaultValue(soapFaultCode);

        soapFaultValue.setText(faultCode.getPrefix() + ":"
                               + faultCode.getLocalPart());

        SOAPFaultSubCode soapFaultSubCode = factory
                .createSOAPFaultSubCode(soapFaultCode);
        SOAPFaultValue soapFaultSubCodeValue = factory
                .createSOAPFaultValue(soapFaultSubCode);

        soapFaultSubCodeValue.setText(faultSubcode.getPrefix() + ":"
                                      + faultSubcode.getLocalPart());

        msgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME,
                               soapFaultCode);
View Full Code Here


        SOAPEnvelope envelope = messageContext.getEnvelope();
        SOAPFactory fac = (SOAPFactory) envelope.getOMFactory();
        String soapNSURI = fac.getSoapVersionURI();
       
        SOAPFaultCode faultCode = fac.createSOAPFaultCode();
        SOAPFaultValue faultCodeValue = fac.createSOAPFaultValue(faultCode);
        faultCodeValue.setText(wste.getCode());

        SOAPFaultSubCode faultSubCode = fac.createSOAPFaultSubCode(faultCode);
        SOAPFaultValue faultSubCodeValue = fac.createSOAPFaultValue(faultSubCode);
        faultSubCodeValue.setText(wste.getSubCode());
       
        SOAPFaultReason faultReason = fac.createSOAPFaultReason();
        SOAPFaultText faultText = fac.createSOAPFaultText(faultReason);
        faultText.setText(wste.getReason());       
       
View Full Code Here

          }
            if (context.isSOAP11()) {
              if(log.isDebugEnabled()){
                log.debug("context.isSOAP11() = true");
                SOAPFaultCode code = (fault!=null)?fault.getCode():null;
                SOAPFaultValue value = (code!=null)?code.getValue():null;
                if(value !=null){
                  QName name = value.getQName();
                  log.debug("prefix ="+name.getPrefix());
                  log.debug("Fault Code namespace ="+name.getNamespaceURI());
                  log.debug("Fault Code ="+name.getLocalPart());
                }
              }

                fault.getCode().setText(soapFaultCode);
            } else {
              if(log.isDebugEnabled()){
                log.debug("context.isSOAP11() = false");
                SOAPFaultCode code = (fault!=null)?fault.getCode():null;
                SOAPFaultValue value = (code!=null)?code.getValue():null;
                if(value !=null){
                  QName name = value.getQName();
                  log.debug("prefix ="+name.getPrefix());
                  log.debug("Fault Code namespace ="+name.getNamespaceURI());
                  log.debug("Fault Code ="+name.getLocalPart());
                }
              }
                SOAPFaultValue value = fault.getCode().getValue();
                if(log.isDebugEnabled()){
                    log.debug("soapFaultCode originally was set to : " + soapFaultCode);
                }
                OMNamespace namespace = value.getNamespace();
                soapFaultCode = switchNamespacePrefix(soapFaultCode, namespace);
                value.setText(soapFaultCode);
            }
        }
       
        if (axisFault != null && !context.isSOAP11()) {
            if (axisFault.getFaultSubCodes() != null) {
               
                List faultSubCodes = axisFault.getFaultSubCodes();
               
                QName faultSubCodeQName;

                for (Object faultSubCode : faultSubCodes) {

                    faultSubCodeQName = (QName)faultSubCode;

                    SOAPFactory sf = (SOAPFactory)envelope.getOMFactory();
                    SOAPFaultSubCode soapFaultSubCode = sf.createSOAPFaultSubCode(fault.getCode());
                    SOAPFaultValue saopFaultValue = sf.createSOAPFaultValue(fault.getCode());
                    saopFaultValue.setText(faultSubCodeQName);
                    soapFaultSubCode.setValue(saopFaultValue);
                    fault.getCode().setSubCode(soapFaultSubCode);
                }
               
            }
View Full Code Here

            SOAPFaultText soapFaultText = soapFactory.createSOAPFaultText();
            soapFaultText.setText(reason);
            soapFaultReason.addSOAPText(soapFaultText);
            message.getBody().getFault().setReason(soapFaultReason);
            SOAPFaultCode soapFaultCode = soapFactory.createSOAPFaultCode();
            SOAPFaultValue soapFaultValue = soapFactory.createSOAPFaultValue(soapFaultCode);
            soapFaultValue.setText(code);
            soapFaultCode.setValue(soapFaultValue);
            SOAPFaultSubCode soapFaultSubCode = soapFactory.createSOAPFaultSubCode(soapFaultCode);
            SOAPFaultValue soapFaultValueSub = soapFactory.createSOAPFaultValue(soapFaultSubCode);
            QName qNameSubCode = new QName("http://wso2.org/passivests", subCode, "sts");
            soapFaultValueSub.setText(qNameSubCode);
            soapFaultSubCode.setValue(soapFaultValueSub);
            soapFaultCode.setSubCode(soapFaultSubCode);
            message.getBody().getFault().setCode(soapFaultCode);
            return message.getBody().getFault();
        }
View Full Code Here

                                          SOAPFaultCode sourceCode) {
        SOAPFaultCode targetCode = factory.createSOAPFaultCode(targetFault);
        copyTagData(sourceCode, targetCode);

        // Create the Value
        SOAPFaultValue sourceValue = sourceCode.getValue();
        SOAPFaultValue targetValue = factory.createSOAPFaultValue(targetCode);
        copyTagData(sourceValue, targetValue);
       
        // There should only be a text node for the value, but in case there is more
        Iterator i = sourceValue.getChildren();
        while (i.hasNext()) {
View Full Code Here

            targetSubCode = factory.createSOAPFaultSubCode((SOAPFaultCode) targetParent);
        }
        copyTagData(sourceSubCode, targetSubCode);

        // Process the SOAP FaultValue
        SOAPFaultValue sourceValue = sourceSubCode.getValue();
        SOAPFaultValue targetValue = factory.createSOAPFaultValue(targetSubCode);
        copyTagData(sourceValue, targetValue);
        // There should only be a text node for the value, but in case there is more
        Iterator i = sourceValue.getChildren();
        while (i.hasNext()) {
            OMNode node = (OMNode) i.next();
View Full Code Here

                   
                    faultSubCodeQName = (QName) subCodeiter.next();
                                       
                    SOAPFactory sf = (SOAPFactory)envelope.getOMFactory();
                    SOAPFaultSubCode soapFaultSubCode = sf.createSOAPFaultSubCode(fault.getCode());
                    SOAPFaultValue saopFaultValue = sf.createSOAPFaultValue(fault.getCode());
                    saopFaultValue.setText(faultSubCodeQName);
                    soapFaultSubCode.setValue(saopFaultValue);
                    fault.getCode().setSubCode(soapFaultSubCode);
                }
               
            }
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

        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

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.