Package org.apache.woden.wsdl20.xml

Examples of org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement


    InterfaceFaultReference[] ifrArray = fInterfaceOperation.getInterfaceFaultReferences();
    assertNotNull("Expected an array of InterfaceFaultReference.", ifrArray);
    assertEquals("Retrieved InterfaceFaultReferenceElement group should be empty if none set -", 0, ifrArray.length);

    // create some InterfaceFaultReferenceElements
    InterfaceFaultReferenceElement ifr1 = fInterfaceOperationElement.addInterfaceFaultReferenceElement();
    InterfaceFaultReferenceElement ifr2 = fInterfaceOperationElement.addInterfaceFaultReferenceElement();
    fDescription = fDescriptionElement.toComponent();
   
    // getInterfaceFaultReferenceElements()
    ifrArray = fInterfaceOperation.getInterfaceFaultReferences();
    assertNotNull("Expected an array of InterfaceFaultReference.", ifrArray);
View Full Code Here


        // add operation level faults
        InterfaceFaultReference[] faults = operation.getInterfaceFaultReferences();
        for (int i = 0; i < faults.length; i++) {
            AxisMessage faultMessage = new AxisMessage();

            InterfaceFaultReferenceElement interfaceFaultReferenceElement = faults[i].toElement();
            faultMessage.setDirection(interfaceFaultReferenceElement.getDirection().toString());

            faultMessage.setElementQName(interfaceFaultReferenceElement.getInterfaceFaultElement().getElementName());
            faultMessage.setName(interfaceFaultReferenceElement.getRef().getLocalPart());
            axisOperation.setFaultMessages(faultMessage);
        }


        return axisOperation;
View Full Code Here

            InterfaceFaultReferenceElement[] interfaceFaultReferenceElements = opElement
                    .getInterfaceFaultReferenceElements();

            for (int i = 0; i < interfaceFaultReferenceElements.length; i++) {
                InterfaceFaultReferenceElement interfaceFaultReferenceElement = interfaceFaultReferenceElements[i];
                String direction = interfaceFaultReferenceElement
                        .getDirection().toString();
                messagesMap.put(interfaceFaultReferenceElement.getRef(),
                        interfaceFaultReferenceElement);
                faultyOperationsMap.put(interfaceFaultReferenceElement
                        .getInterfaceFaultElement(),
                        interfaceFaultReferenceElement);
            }

        }
View Full Code Here

     boolean isValid = true;
    
     int numFaultReferences = faultReferences.length;
     for(int k = 0; k < numFaultReferences; k++)
     {
        InterfaceFaultReferenceElement faultReference = faultReferences[k];
        if(!testAssertionQNameResolution1064ForInterfaceFaultReference(faultReference, errorReporter))
          isValid = false;
     }
    
     return isValid;
View Full Code Here

            XMLElement faultRefEl,
            DescriptionElement desc,
            InterfaceOperationElement parent)
            throws WSDLException {

        InterfaceFaultReferenceElement faultRef = parent.addInterfaceFaultReferenceElement();

        if(Constants.ELEM_INFAULT.equals(faultRefEl.getLocalName())) {
            faultRef.setDirection(Direction.IN);
        }
        else if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName())){
            faultRef.setDirection(Direction.OUT);
        }

        String ref = faultRefEl.getAttributeValue(Constants.ATTR_REF);
        if(ref != null)
        {
            try {
                QName qname = faultRefEl.getQName(ref);
                faultRef.setRef(qname);
            } catch (WSDLException e) {
                getErrorReporter().reportError(
                        new ErrorLocatorImpl()//TODO line&col nos.
                        "WSDL505",
                        new Object[] {ref, faultRefEl.getQName()},
                        ErrorReporter.SEVERITY_ERROR);
            }
        }

        String msgLabel = faultRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
        if(msgLabel != null)
        {
            faultRef.setMessageLabel(new NCName(msgLabel));
        }
        else
        {
            //This is a limited solution supporting the 3 MEPs in the Part 2 spec.
            //TODO generic support for user-defined, extensible MEPs.
           
            InterfaceOperationElement iop = (InterfaceOperationElement)faultRef.getParentElement();
            URI mep = iop.getPattern();
           
            if(Constants.MEP_URI_IN_OUT.equals(mep))
            {
                //Ruleset is fault-replaces-message, so fault is in same direction as msg.
                //The <output> is replaced by an <outfault>.
                //The <input> is replaced by an <infault>.
                //The <outfault> msg label should match the <output> msg label.
                if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName()))
                {
                    faultRef.setMessageLabel(MessageLabel.OUT);
                }
                else
                {
                    faultRef.setMessageLabel(MessageLabel.IN);
                }
            }
            else if(Constants.MEP_URI_ROBUST_IN_ONLY.equals(mep)) 
            {
                //Ruleset is message-triggers-fault, so fault is opposite direction to msg.
                //The <input> can trigger an <outfault>.
                //The <outfault> msg label should match the <input> msg label.
                if(Constants.ELEM_OUTFAULT.equals(faultRefEl.getLocalName()))
                {
                    faultRef.setMessageLabel(MessageLabel.IN); //the <outfault> is triggered by the <input>
                }
                else
                {
                    //TODO this MEP may have only <outfault>s, not <infault>s, so treat this as an error.
                    faultRef.setMessageLabel(MessageLabel.OUT);
                }
            }
            else if(Constants.MEP_URI_IN_ONLY.equals(mep))
            {
                //TODO Ruleset is no-faults, so treat this as an error.
            }
        }

        parseExtensionAttributes(faultRefEl, InterfaceFaultReferenceElement.class, faultRef, desc);

        XMLElement[] children = faultRefEl.getChildElements();
        XMLElement tempEl = null;
        QName tempElQN = null;

        for(int i=0; i<children.length; i++)
        {
            tempEl = children[i];
            tempElQN = tempEl.getQName();

            if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
            {
                parseDocumentation(tempEl, desc, faultRef);
            }
            else
            {
                faultRef.addExtensionElement(
                        parseExtensionElement(InterfaceFaultReferenceElement.class, faultRef, tempEl, desc) );
            }
        }

        return faultRef;
View Full Code Here

                                                        DescriptionElement des,
                                                        PrintWriter pw)
                                                        throws WSDLException{
        for(int ind=0;ind<faulRefs.length;ind++){

            InterfaceFaultReferenceElement faulRef=faulRefs[ind];
            if(faulRef!=null){

                String tagName =null;
                Direction msgDirection=faulRef.getDirection();
                if(msgDirection==Direction.IN){
                    tagName=DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                            Constants.ELEM_INFAULT,
                            faulRef);
                }else if(msgDirection==Direction.OUT){

                    tagName=DOMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                            Constants.ELEM_OUTFAULT,
                            faulRef);

                }

                pw.print("      <" + tagName);

                String msglable=faulRef.getMessageLabel().toString();

                DOMUtils.printAttribute(Constants.ATTR_MESSAGE_LABEL, msglable, pw);


                QName attrQName=faulRef.getRef();
                String attrName=
                    DOMUtils.getQualifiedValue(faulRef.getNamespaceURI(attrQName.getPrefix()).toString(),
                        attrQName.getLocalPart(),
                        faulRef);
                DOMUtils.printAttribute(Constants.ATTR_REF, attrName, pw);
               
                printExtensibilityAttributes(faulRef.getExtensionAttributes(), faulRef, pw);
                pw.println('>');
                printDocumentation(faulRef.getDocumentationElements(), des, pw);
                printExtensibilityElements(faulRef.getClass(), faulRef.getExtensionElements(), des, pw);
                pw.println("    </" + tagName + '>');
            }


View Full Code Here

                                                        DescriptionElement des,
                                                        PrintWriter pw)
                                                        throws WSDLException{
       for(int ind=0;ind<faulRefs.length;ind++){

            InterfaceFaultReferenceElement faulRef=faulRefs[ind];
            if(faulRef!=null){
                String tagName =null;
                Direction msgDirection=faulRef.getDirection();
                if(msgDirection==Direction.IN){
                    tagName=OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                            Constants.ELEM_INFAULT,
                            faulRef);
                }else if(msgDirection==Direction.OUT){

                    tagName=OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                            Constants.ELEM_OUTFAULT,
                            faulRef);

                }
                pw.print("      <" + tagName);
                String msglable=faulRef.getMessageLabel().toString();
                OMUtils.printAttribute(Constants.ATTR_MESSAGE_LABEL, msglable, pw);

                QName attrQName=faulRef.getRef();
                String attrName=
                    OMUtils.getQualifiedValue(faulRef.getNamespaceURI(attrQName.getPrefix()).toString(),
                        attrQName.getLocalPart(),
                        faulRef);
                OMUtils.printAttribute(Constants.ATTR_REF, attrName, pw);

                printExtensibilityAttributes(faulRef.getExtensionAttributes(), faulRef, pw);
                pw.println('>');
                printDocumentation(faulRef.getDocumentationElements(), des, pw);
                printExtensibilityElements(faulRef.getClass(), faulRef.getExtensionElements(), des, pw);
                pw.println("    </" + tagName + '>');
            }


View Full Code Here

        QName elementQName = null;

        if (WSDL2Constants.NMTOKEN_ELEMENT.equals(messageContentModelName)) {
            ElementDeclaration elementDeclaration = messageReference.getElementDeclaration();
            if (elementDeclaration == null) {
                InterfaceMessageReferenceElement messageReferenceElement =
                        messageReference.toElement();
                QName qName = messageReferenceElement.getElement().getQName();
                throw new AxisFault("Unable to find element " + qName.toString() + " reffered to by operation " + axisOperation.getName().getLocalPart());
            }
            elementQName = elementDeclaration.getName();
        } else if (WSDL2Constants.NMTOKEN_ANY.equals(messageContentModelName)) {
            elementQName = Constants.XSD_ANY;
View Full Code Here

            // }
            //
            // }

            DescriptionElement descriptionElement = description.toElement();
            TypesElement typesElement = descriptionElement
                    .getTypesElement();
            if (typesElement != null) {
                Schema[] schemas = typesElement.getSchemas();
                for (int i = 0; i < schemas.length; i++) {
                    XmlSchema schemaDefinition = schemas[i].getSchemaDefinition();

                    // WSDL 2.0 spec requires that even the built-in schema should be returned
                    // once asked for schema definitions. But for data binding purposes we can ignore that
View Full Code Here

        XmlSchemaElement xse = null;
        if(fElement != null && fElement.isQName()) {
            InterfaceOperationElement oper = (InterfaceOperationElement)getParentElement();
            InterfaceElement interfac = (InterfaceElement)oper.getParentElement();
            DescriptionElement desc = (DescriptionElement)interfac.getParentElement();
            TypesElement types = desc.getTypesElement();
            if(types != null) {
                xse = ((TypesImpl)types).getElementDeclaration(fElement.getQName());
            }
        }
        return xse;
View Full Code Here

TOP

Related Classes of org.apache.woden.wsdl20.xml.InterfaceFaultReferenceElement

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.