Package org.apache.axis.description

Examples of org.apache.axis.description.FaultDesc


            operationDesc.setReturnClass(void.class);
        }

        // Build faults
        for (final JaxRpcFaultInfo faultInfo : operationInfo.faults) {
            final FaultDesc faultDesc = buildFaultDesc(faultInfo);
            operationDesc.addFault(faultDesc);
        }

        return operationDesc;
    }
View Full Code Here


        final ParameterDesc parameterDesc = new ParameterDesc(parameterInfo.qname, mode, parameterInfo.xmlType, javaType, inHeader, outHeader);
        return parameterDesc;
    }

    private FaultDesc buildFaultDesc(final JaxRpcFaultInfo faultInfo) throws OpenEJBException {
        final FaultDesc faultDesc = new FaultDesc(faultInfo.qname, faultInfo.javaType, faultInfo.xmlType, faultInfo.complex);

        final ArrayList<ParameterDesc> parameters = new ArrayList<ParameterDesc>();
        for (final JaxRpcParameterInfo parameterInfo : faultInfo.parameters) {
            final ParameterDesc parameterDesc = buildParameterDesc(parameterInfo);
            parameters.add(parameterDesc);
        }
        faultDesc.setParameters(parameters);

        return faultDesc;
    }
View Full Code Here

        def.addMessage(msg);

        ArrayList exceptions = desc.getFaults();

        for (int i = 0; (exceptions != null) && (i < exceptions.size()); i++) {
            FaultDesc faultDesc = (FaultDesc) exceptions.get(i);

            msg = writeFaultMessage(def, faultDesc);

            // Add the fault to the portType
            Fault fault = def.createFault();

            fault.setMessage(msg);
            fault.setName(faultDesc.getName());
            oper.addFault(fault);

            // Add the fault to the binding
            BindingFault bFault = def.createBindingFault();

            bFault.setName(faultDesc.getName());

            SOAPFault soapFault = writeSOAPFault(faultDesc);

            bFault.addExtensibilityElement(soapFault);
            bindingOper.addBindingFault(bFault);
View Full Code Here

        // Faults clause
        ArrayList faultList = desc.getFaults();

        if (faultList != null) {
            for (Iterator it = faultList.iterator(); it.hasNext();) {
                FaultDesc faultDesc = (FaultDesc) it.next();

                // Get a soap:fault
                ExtensibilityElement soapFault = writeSOAPFault(faultDesc);

                // Get a wsdl:fault to put the soap:fault in
                BindingFault bindingFault = new BindingFaultImpl();

                bindingFault.setName(faultDesc.getName());
                bindingFault.addExtensibilityElement(soapFault);
                bindingOper.addBindingFault(bindingFault);
            }
        }
View Full Code Here

        SOAPConstants soapConstants = msgContext.getSOAPConstants();
        OperationDesc op = msgContext.getOperation();
        Class faultClass = null;
        QName faultXmlType = null;
        if (op != null) {
            FaultDesc faultDesc = null;
            // allow fault type to be denoted in xsi:type
            faultXmlType = context.getTypeFromAttributes(namespace,
                                                         name,
                                                         attributes);
            if (faultXmlType != null) {
                faultDesc = op.getFaultByXmlType(faultXmlType);
            }

            // If we didn't get type information, look up QName of fault
            if (faultDesc == null) {
                faultDesc = op.getFaultByQName(qn);
                if ((faultXmlType == null) && (faultDesc != null)) {
                    faultXmlType = faultDesc.getXmlType();
                }
            }

            // Set the class if we found a description
            if (faultDesc != null) {
                try {
                    faultClass = ClassUtils.forName(faultDesc.getClassName());
                } catch (ClassNotFoundException e) {
                    // Just create an AxisFault, no custom exception
                }
            }
        } else {
View Full Code Here

        if (operation == null) {
            operation = new OperationDesc();
        }

        FaultDesc fault = new FaultDesc();
        fault.setQName(qname);
        fault.setClassName(cls.getName());
        fault.setXmlType(xmlType);
        fault.setComplex(isComplex);
        operation.addFault(fault);
    }
View Full Code Here

        }
       
        ArrayList faults = desc.getFaults();
        if (faults != null) {
            for (Iterator i = faults.iterator(); i.hasNext();) {
                FaultDesc faultDesc = (FaultDesc) i.next();
                WSDDFault f = new WSDDFault(faultDesc);
                f.writeToContext(context);
            }
        }
View Full Code Here

    }

    private QName getFaultQName(Class cls, SerializationContext context) {
        QName qname = null;      
        if (! cls.equals(AxisFault.class)) {
            FaultDesc faultDesc = null;
            if (context.getMessageContext() != null) {
                OperationDesc op = context.getMessageContext().getOperation();
                if (op != null) {
                    faultDesc = op.getFaultByClass(cls);
                }
            }
               
            if (faultDesc != null) {
                qname = faultDesc.getQName();
            }
        }
        return qname;
    }
View Full Code Here

        // Look up this element in our faultMap
        // if we find a match, this element is the fault data
        MessageContext msgContext = context.getMessageContext();
        OperationDesc op = msgContext.getOperation();
        if (op != null) {
            FaultDesc faultDesc = op.getFaultByQName(qn);
            if (faultDesc != null) {
                // Set the class
                try {
                    Class faultClass = ClassUtils.forName(faultDesc.getClassName());
                    builder.setFaultClass(faultClass);
                } catch (ClassNotFoundException e) {
                    // Just create an AxisFault, no custom exception
                }
                builder.setWaiting(true);
                // register callback for the data, use the xmlType from fault info
                Deserializer dser = null;
                if (attributes.getValue("href") == null) {
                    dser = context.getDeserializerForType(faultDesc.getXmlType());
                } else {
                    dser = new DeserializerImpl();
                    dser.setDefaultType(faultDesc.getXmlType());
                }
                if (dser != null) {
                    dser.registerValueTarget(new CallbackTarget(this, "faultData"));
                }
                return (SOAPHandler)dser;
View Full Code Here

           
            // get the QName for this faults detail element
            Class cls = fault.getClass();
            QName qname = null;
            if (! cls.equals(AxisFault.class)) {
                FaultDesc faultDesc =
                        context.getMessageContext().getOperation().getFaultByClass(cls);
                qname = faultDesc.getQName();
            }
            if (qname == null) {
                // not the greatest, but...
                qname = new QName("", "faultData");
            }
View Full Code Here

TOP

Related Classes of org.apache.axis.description.FaultDesc

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.