Package com.sun.tools.ws.processor.model

Examples of com.sun.tools.ws.processor.model.Fault


            if(bindingFault == null) {
                warning(portTypeFault,ModelerMessages.WSDLMODELER_INVALID_PORT_TYPE_FAULT_NOT_FOUND(portTypeFault.getName(),info.portTypeOperation.getName()));
            }
            // wsdl:fault message name is used to create the java exception name later on
            String faultName = getFaultClassName(portTypeFault);
            Fault fault = new Fault(faultName, portTypeFault);
            fault.setWsdlFaultName(portTypeFault.getName());
            setDocumentationIfPresent(fault, portTypeFault.getDocumentation());
            if (bindingFault != null) {
                //get the soapbind:fault from wsdl:fault in the binding
                SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class);

                // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
                if (soapFault == null) {
                    if (options.isExtensionMode()) {
                        warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                        soapFault = new SOAPFault(new LocatorImpl());
                    } else {
                        error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                    }
                }

                //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
                if (!soapFault.isLiteral()) {
                    if (options.isExtensionMode()) {
                        warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    } else {
                        error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    }
                    continue;
                }

                // the soapFault name must be present
                if (soapFault.getName() == null) {
                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
                } else if (!soapFault.getName().equals(bindingFault.getName())) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
                } else if (soapFault.getNamespace() != null) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
                }

            }

            com.sun.tools.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
            Iterator iter2 = faultMessage.parts();
            if (!iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(portTypeFault.getName(), faultMessage.getName()));
            }
            MessagePart faultPart = (MessagePart) iter2.next();
            QName faultQName = faultPart.getDescriptor();

            // Don't include fault messages with non-unique soap:fault names
            if (duplicateNames.contains(faultQName)) {
                warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(portTypeFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
                continue;
            }

            if (iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(portTypeFault.getName(), faultMessage.getName()));
            }

            if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
                if (options.isExtensionMode()) {
                    warning(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
                } else {
                    error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
                }
            }

            JAXBType jaxbType = getJAXBType(faultPart);

            fault.setElementName(faultPart.getDescriptor());
            fault.setJavaMemberName(Names.getExceptionClassMemberName());

            Block faultBlock = new Block(faultQName, jaxbType, faultPart);
            fault.setBlock(faultBlock);
            //createParentFault(fault);
            //createSubfaults(fault);
            if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) {
                response.addFaultBlock(faultBlock);
            }
View Full Code Here


        String opName = BindingHelper.mangleNameToVariableName(operation.getName().getLocalPart());
        for (Iterator iter = operation.getFaults();
             iter != null && iter.hasNext();
                ) {
            Fault fault = (Fault) iter.next();
            createJavaExceptionFromLiteralType(fault, port, opName);
        }
        JavaException javaException;
        Fault fault;
        for (Iterator iter = operation.getFaults(); iter.hasNext();) {
            fault = (Fault) iter.next();
            javaException = fault.getJavaException();
            method.addException(javaException.getName());
        }

    }
View Full Code Here

            if(bindingFault == null) {
                warning(portTypeFault,ModelerMessages.WSDLMODELER_INVALID_PORT_TYPE_FAULT_NOT_FOUND(portTypeFault.getName(),info.portTypeOperation.getName()));
            }
            // wsdl:fault message name is used to create the java exception name later on
            String faultName = getFaultClassName(portTypeFault);
            Fault fault = new Fault(faultName, portTypeFault);
            fault.setWsdlFaultName(portTypeFault.getName());
            setDocumentationIfPresent(fault, portTypeFault.getDocumentation());
            String faultNamespaceURI = null;
            if (bindingFault != null) {
                //get the soapbind:fault from wsdl:fault in the binding
                SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class);

                // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
                if (soapFault == null) {
                    if (options.isExtensionMode()) {
                        warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                        soapFault = new SOAPFault(new LocatorImpl());
                    } else {
                        error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                    }
                }

                //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
                if (!soapFault.isLiteral()) {
                    if (options.isExtensionMode())
                        warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    else
                        error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    continue;
                }

                // the soapFault name must be present
                if (soapFault.getName() == null) {
                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
                } else if (!soapFault.getName().equals(bindingFault.getName())) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
                } else if (soapFault.getNamespace() != null) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
                }

                faultNamespaceURI = soapFault.getNamespace();
            }
            if (faultNamespaceURI == null) {
                faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI();
            }

            com.sun.tools.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
            Iterator iter2 = faultMessage.parts();
            if (!iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(portTypeFault.getName(), faultMessage.getName()));
            }
            MessagePart faultPart = (MessagePart) iter2.next();
            QName faultQName = faultPart.getDescriptor();

            // Don't include fault messages with non-unique soap:fault names
            if (duplicateNames.contains(faultQName)) {
                warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(portTypeFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
                continue;
            }

            if (iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(portTypeFault.getName(), faultMessage.getName()));
            }

            if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
                error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
            }

            JAXBType jaxbType = getJAXBType(faultPart);

            fault.setElementName(faultPart.getDescriptor());
            fault.setJavaMemberName(Names.getExceptionClassMemberName());

            Block faultBlock = new Block(faultQName, jaxbType, faultPart);
            fault.setBlock(faultBlock);
            //createParentFault(fault);
            //createSubfaults(fault);
            if (!response.getFaultBlocksMap().containsKey(faultBlock.getName()))
                response.addFaultBlock(faultBlock);
            info.operation.addFault(fault);
View Full Code Here

        String opName = JAXBRIContext.mangleNameToVariableName(operation.getName().getLocalPart());
        for (Iterator iter = operation.getFaults();
             iter != null && iter.hasNext();
                ) {
            Fault fault = (Fault) iter.next();
            createJavaExceptionFromLiteralType(fault, port, opName);
        }
        JavaException javaException;
        Fault fault;
        for (Iterator iter = operation.getFaults(); iter.hasNext();) {
            fault = (Fault) iter.next();
            javaException = fault.getJavaException();
            method.addException(javaException.getName());
        }

    }
View Full Code Here

        operation.getRequest().accept(this);
        if (operation.getResponse() != null)
            operation.getResponse().accept(this);
        Iterator faults = operation.getFaultsSet().iterator();
        if (faults != null) {
            Fault fault;
            while (faults.hasNext()) {
                fault = (Fault) faults.next();
                fault.accept(this);
            }
        }
    }
View Full Code Here

            }

            // wsdl:fault message name is used to create the java exception name later on
            String faultName = getFaultClassName(portTypeFault);
            Fault fault = new Fault(faultName, portTypeFault);
            fault.setWsdlFaultName(portTypeFault.getName());
            setDocumentationIfPresent(fault, portTypeFault.getDocumentation());

            //get the soapbind:fault from wsdl:fault in the binding
            SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class);

            // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
            if (soapFault == null) {
                if(options.isExtensionMode()){
                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                    soapFault = new SOAPFault(new LocatorImpl());
                }else{
                    error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                }
            }

            //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
            if (!soapFault.isLiteral()) {
                if (options.isExtensionMode())
                    warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                else
                    error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                continue;
            }

            // the soapFault name must be present
            if (soapFault.getName() == null) {
                warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
            } else if (!soapFault.getName().equals(bindingFault.getName())) {
                warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
            } else if (soapFault.getNamespace() != null) {
                warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
            }

            String faultNamespaceURI = soapFault.getNamespace();
            if (faultNamespaceURI == null) {
                faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI();
            }

            com.sun.tools.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
            Iterator iter2 = faultMessage.parts();
            if (!iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(bindingFault.getName(), faultMessage.getName()));
            }
            MessagePart faultPart = (MessagePart) iter2.next();
            QName faultQName = faultPart.getDescriptor();

            // Don't include fault messages with non-unique soap:fault names
            if (duplicateNames.contains(faultQName)) {
                warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(bindingFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
                continue;
            }

            if (iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(bindingFault.getName(), faultMessage.getName()));
            }

            if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
                error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
            }

            JAXBType jaxbType = getJAXBType(faultPart);

            fault.setElementName(faultPart.getDescriptor());
            fault.setJavaMemberName(Names.getExceptionClassMemberName());

            Block faultBlock = new Block(faultQName, jaxbType, faultPart);
            fault.setBlock(faultBlock);
            //createParentFault(fault);
            //createSubfaults(fault);
            if (!response.getFaultBlocksMap().containsKey(faultBlock.getName()))
                response.addFaultBlock(faultBlock);
            info.operation.addFault(fault);
View Full Code Here

        String opName = JAXBRIContext.mangleNameToVariableName(operation.getName().getLocalPart());
        for (Iterator iter = operation.getFaults();
             iter != null && iter.hasNext();
                ) {
            Fault fault = (Fault) iter.next();
            createJavaExceptionFromLiteralType(fault, port, opName);
        }
        JavaException javaException;
        Fault fault;
        for (Iterator iter = operation.getFaults(); iter.hasNext();) {
            fault = (Fault) iter.next();
            javaException = fault.getJavaException();
            method.addException(javaException.getName());
        }

    }
View Full Code Here

            if(bindingFault == null) {
                warning(portTypeFault,ModelerMessages.WSDLMODELER_INVALID_PORT_TYPE_FAULT_NOT_FOUND(portTypeFault.getName(),info.portTypeOperation.getName()));
            }
            // wsdl:fault message name is used to create the java exception name later on
            String faultName = getFaultClassName(portTypeFault);
            Fault fault = new Fault(faultName, portTypeFault);
            fault.setWsdlFaultName(portTypeFault.getName());
            setDocumentationIfPresent(fault, portTypeFault.getDocumentation());
            if (bindingFault != null) {
                //get the soapbind:fault from wsdl:fault in the binding
                SOAPFault soapFault = (SOAPFault) getExtensionOfType(bindingFault, SOAPFault.class);

                // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
                if (soapFault == null) {
                    if (options.isExtensionMode()) {
                        warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                        soapFault = new SOAPFault(new LocatorImpl());
                    } else {
                        error(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_OUTPUT_MISSING_SOAP_FAULT(bindingFault.getName(), info.bindingOperation.getName()));
                    }
                }

                //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
                if (!soapFault.isLiteral()) {
                    if (options.isExtensionMode()) {
                        warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_IGNORING_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    } else {
                        error(soapFault, ModelerMessages.WSDLMODELER_INVALID_OPERATION_FAULT_NOT_LITERAL(bindingFault.getName(), info.bindingOperation.getName()));
                    }
                    continue;
                }

                // the soapFault name must be present
                if (soapFault.getName() == null) {
                    warning(bindingFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_NO_SOAP_FAULT_NAME(bindingFault.getName(), info.bindingOperation.getName()));
                } else if (!soapFault.getName().equals(bindingFault.getName())) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_WRONG_SOAP_FAULT_NAME(soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()));
                } else if (soapFault.getNamespace() != null) {
                    warning(soapFault, ModelerMessages.WSDLMODELER_WARNING_R_2716_R_2726("soapbind:fault", soapFault.getName()));
                }

            }

            com.sun.tools.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
            Iterator iter2 = faultMessage.parts();
            if (!iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_EMPTY_MESSAGE(portTypeFault.getName(), faultMessage.getName()));
            }
            MessagePart faultPart = (MessagePart) iter2.next();
            QName faultQName = faultPart.getDescriptor();

            // Don't include fault messages with non-unique soap:fault names
            if (duplicateNames.contains(faultQName)) {
                warning(faultPart, ModelerMessages.WSDLMODELER_DUPLICATE_FAULT_SOAP_NAME(portTypeFault.getName(), info.portTypeOperation.getName(), faultPart.getName()));
                continue;
            }

            if (iter2.hasNext()) {
                // the WSDL document is invalid
                error(faultMessage, ModelerMessages.WSDLMODELER_INVALID_BINDING_FAULT_MESSAGE_HAS_MORE_THAN_ONE_PART(portTypeFault.getName(), faultMessage.getName()));
            }

            if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
                if (options.isExtensionMode()) {
                    warning(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
                } else {
                    error(faultPart, ModelerMessages.WSDLMODELER_INVALID_MESSAGE_PART_MUST_HAVE_ELEMENT_DESCRIPTOR(faultMessage.getName(), faultPart.getName()));
                }
            }

            JAXBType jaxbType = getJAXBType(faultPart);

            fault.setElementName(faultPart.getDescriptor());
            fault.setJavaMemberName(Names.getExceptionClassMemberName());

            Block faultBlock = new Block(faultQName, jaxbType, faultPart);
            fault.setBlock(faultBlock);
            //createParentFault(fault);
            //createSubfaults(fault);
            if (!response.getFaultBlocksMap().containsKey(faultBlock.getName())) {
                response.addFaultBlock(faultBlock);
            }
View Full Code Here

        String opName = BindingHelper.mangleNameToVariableName(operation.getName().getLocalPart());
        for (Iterator iter = operation.getFaults();
             iter != null && iter.hasNext();
                ) {
            Fault fault = (Fault) iter.next();
            createJavaExceptionFromLiteralType(fault, port, opName);
        }
        JavaException javaException;
        Fault fault;
        for (Iterator iter = operation.getFaults(); iter.hasNext();) {
            fault = (Fault) iter.next();
            javaException = fault.getJavaException();
            method.addException(javaException.getName());
        }

    }
View Full Code Here

        if (operation.getResponse() != null) {
            operation.getResponse().accept(this);
        }
        Iterator faults = operation.getFaultsSet().iterator();
        if (faults != null) {
            Fault fault;
            while (faults.hasNext()) {
                fault = (Fault) faults.next();
                fault.accept(this);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.tools.ws.processor.model.Fault

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.