Package org.apache.axiom.soap

Examples of org.apache.axiom.soap.SOAPFaultSubCode


       
        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);
View Full Code Here


                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

            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

            OMNode node = (OMNode) i.next();
            copy(factory, targetValue, node);
        }

        // Now get process the SubCode
        SOAPFaultSubCode sourceSubCode = sourceCode.getSubCode();
        if (sourceSubCode != null) {
            copySOAPFaultSubCode(factory, targetCode, sourceSubCode);
        }
    }
View Full Code Here

     * @param sourceSubCode
     */
    private static void copySOAPFaultSubCode(SOAPFactory factory,
                                             OMElement targetParent,
                                             SOAPFaultSubCode sourceSubCode) {
        SOAPFaultSubCode targetSubCode;
        if (targetParent instanceof SOAPFaultSubCode) {
            targetSubCode = factory.createSOAPFaultSubCode((SOAPFaultSubCode) targetParent);
        } else {
            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();
            copy(factory, targetValue, node);
        }

        // Now process the SubCode of the SubCode
        SOAPFaultSubCode sourceSubSubCode = sourceSubCode.getSubCode();
        if (sourceSubSubCode != null) {
            copySOAPFaultSubCode(factory, targetSubCode, sourceSubSubCode);
        }
    }
View Full Code Here

                for (Iterator subCodeiter = faultSubCodes.iterator(); subCodeiter.hasNext(); ) {
                   
                    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

                }
            }

            String faultLocalName;
            SOAPFaultCode code = fault.getCode();
            SOAPFaultSubCode subCode = code.getSubCode();
            if (subCode == null) {
                faultLocalName = code.getTextAsQName().getLocalPart();
            } else {
                while (subCode.getSubCode() != null) {
                    subCode = subCode.getSubCode();
                }
                faultLocalName = subCode.getValue().getTextAsQName().getLocalPart();
            }

            String newReason = AddressingFaultsHelper
                    .getMessageForAxisFault(faultLocalName, faultDetailString);
View Full Code Here

        XMLFault xmlFault = new XMLFault(code, reason, detailBlocks);

        // Add the secondary fault information

        // Get the SubCodes
        SOAPFaultSubCode soapSubCode = soapCode.getSubCode();
        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
            QName[] qNames = new QName[list.size()];
            xmlFault.setSubCodes(list.toArray(qNames));
View Full Code Here

        // 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;
View Full Code Here

        if (soapFaultCode != null) {
            // This works the same regardless of SOAP version
            faultCode = soapFaultCode.getTextAsQName();

            SOAPFaultSubCode subCode = soapFaultCode.getSubCode();
            if (subCode != null) {
                faultSubCodes = new ArrayList();
                while (subCode != null) {
                    faultSubCodes.add(subCode.getValue().getTextAsQName());
                    subCode = subCode.getSubCode();
                }
            }
        }
    }
View Full Code Here

TOP

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

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.