Package org.apache.woden.wsdl20.xml

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


        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


        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

        // axisOperation, PORT_TYPE_OPERATION);

        InterfaceMessageReference[] interfaceMessageReferences = operation
                .getInterfaceMessageReferences();
        for (int i = 0; i < interfaceMessageReferences.length; i++) {
            InterfaceMessageReferenceElement messageReference = interfaceMessageReferences[i].toElement();
            if (messageReference.getMessageLabel().equals(
                    messageReference.getMessageLabel().IN)) {
                // Its an input message

                if (isServerSide) {
                    AxisMessage inMessage = axisOperation
                            .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

                    inMessage.setElementQName(messageReference.getElementName());
                    inMessage.setName(messageReference.getElementName().getLocalPart());
                    // TODO copy policy elements
                } else {
                    AxisMessage inMessage = axisOperation
                            .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

                    inMessage.setElementQName(messageReference.getElementName());
                    inMessage.setName(messageReference.getElementName().getLocalPart());
                    // TODO copy policy elements
                }
            } else if (messageReference.getMessageLabel().equals(
                    messageReference.getMessageLabel().OUT)) {
                if (isServerSide) {
                    AxisMessage outMessage = axisOperation
                            .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

                    outMessage.setElementQName(messageReference.getElementName());
                    outMessage.setName(messageReference.getElementName().getLocalPart());
//                  TODO copy policy elements
                } else {
                    AxisMessage outMessage = axisOperation
                            .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

                    outMessage.setElementQName(messageReference.getElementName());
                    outMessage.setName(messageReference.getElementName().getLocalPart());
//                  TODO copy policy elements
                }
            }

        }
View Full Code Here

            opElement = operationElements[k];
            InterfaceMessageReferenceElement[] interfaceMessageReferenceElements = opElement
                    .getInterfaceMessageReferenceElements();

            for (int i = 0; i < interfaceMessageReferenceElements.length; i++) {
                InterfaceMessageReferenceElement interfaceMessageReferenceElement = interfaceMessageReferenceElements[i];
                String direction = interfaceMessageReferenceElement
                        .getDirection().toString();
                messagesMap.put(interfaceMessageReferenceElement
                        .getElementName(), interfaceMessageReferenceElement);
                if (Direction.IN.toString().equalsIgnoreCase(direction)) {
                    inputOperationsMap.put(opElement.getName(),
                            interfaceMessageReferenceElement);
                } else if (Direction.OUT.toString().equalsIgnoreCase(direction)) {
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

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

        InterfaceMessageReferenceElement message = parent.addInterfaceMessageReferenceElement();

        if(Constants.ELEM_INPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.IN);
        }
        else if(Constants.ELEM_OUTPUT.equals(msgRefEl.getLocalName())) {
            message.setDirection(Direction.OUT);
        }

        String msgLabel = msgRefEl.getAttributeValue(Constants.ATTR_MESSAGE_LABEL);
        if(msgLabel != null)
        {
            message.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.
            if(message.getDirection().equals(Direction.IN))
            {
                message.setMessageLabel(MessageLabel.IN);
            }
            else
            {
                message.setMessageLabel(MessageLabel.OUT);
            }
        }

        String element = msgRefEl.getAttributeValue(Constants.ATTR_ELEMENT);
        if(element != null)
        {
            if(element.equals(Constants.NMTOKEN_ANY)) {
                message.setElement(QNameTokenUnion.ANY);
            } else if(element.equals(Constants.NMTOKEN_NONE)) {
                message.setElement(QNameTokenUnion.NONE);
            } else if(element.equals(Constants.NMTOKEN_OTHER)) {
                message.setElement(QNameTokenUnion.OTHER);
            } else {
                //It is not one of the allowed xs:Token values, so it must be an xs:QName
                try {
                    QNameTokenUnion qname = new QNameTokenUnion(msgRefEl.getQName(element));
                    message.setElement(qname);
                } catch (WSDLException e) {
                    getErrorReporter().reportError(
                            new ErrorLocatorImpl()//TODO line&col nos.
                            "WSDL505",
                            new Object[] {element, msgRefEl.getQName()},
                            ErrorReporter.SEVERITY_ERROR);
                }
            }
        }

        parseExtensionAttributes(msgRefEl, InterfaceMessageReferenceElement.class, message, desc);

        XMLElement[] children = msgRefEl.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, message);
            }
            else
            {
                message.addExtensionElement(
                        parseExtensionElement(InterfaceMessageReferenceElement.class, message, tempEl, desc) );
            }
        }

        return message;
View Full Code Here

            PrintWriter pw)
              throws WSDLException
     {

        for(int ind=0;ind<msgrefs.length;ind++){
            InterfaceMessageReferenceElement msgRef=msgrefs[ind];
            if(msgRef!=null){

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

            pw.print("      <" + tagName);

            String msglable=msgRef.getMessageLabel().toString();
            DOMUtils.printAttribute(Constants.ATTR_MESSAGE_LABEL, msglable, pw);

            QNameTokenUnion qtu = msgRef.getElement();
            if(qtu != null) {
                if(qtu.isQName()) {
                    QName element=qtu.getQName();
                    URI ns=msgRef.getNamespaceURI(element.getPrefix());
                    String attrName;
                    if(ns!=null){
                        attrName=
                            DOMUtils.getQualifiedValue(msgRef.getNamespaceURI(element.getPrefix()).toString(),
                                    element.getLocalPart(), msgRef);
                    }else{
                        attrName=element.getLocalPart();
                    }
                    DOMUtils.printAttribute(Constants.ATTR_ELEMENT, attrName, pw);
                } else {
                    //qtu is a Token
                    DOMUtils.printAttribute(Constants.ATTR_ELEMENT, qtu.getToken(), pw);
                }
            }
            printExtensibilityAttributes(msgRef.getExtensionAttributes(), msgRef, pw);
            pw.println('>');
            printDocumentation(msgRef.getDocumentationElements(), des, pw);
            printExtensibilityElements(msgRef.getClass(), msgRef.getExtensionElements(), des, pw);
            pw.println("    </" + tagName + '>');
        }
      }
    }
View Full Code Here

            DescriptionElement des,
            PrintWriter pw)
              throws WSDLException
     {
       for(int ind=0;ind<msgrefs.length;ind++){
             InterfaceMessageReferenceElement msgRef=msgrefs[ind];
             if(msgRef!=null){
                 String tagName =null;
                 Direction msgDirection=msgRef.getDirection();
                 if(msgDirection==Direction.IN){
                     tagName=OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                              Constants.ELEM_INPUT,
                              msgRef);
                 }else if(msgDirection==Direction.OUT){
                     tagName=OMUtils.getQualifiedValue(Constants.NS_URI_WSDL20,
                              Constants.ELEM_OUTPUT,
                              msgRef);            }

             pw.print("      <" + tagName);

             String msglable=msgRef.getMessageLabel().toString();
             OMUtils.printAttribute(Constants.ATTR_MESSAGE_LABEL, msglable, pw);

             QNameTokenUnion qtu = msgRef.getElement();
             if(qtu != null) {
                 if(qtu.isQName()) {
                     QName element=qtu.getQName();
                     URI ns=msgRef.getNamespaceURI(element.getPrefix());
                     String attrName;
                     if(ns!=null){
                         attrName=
                             OMUtils.getQualifiedValue(msgRef.getNamespaceURI(element.getPrefix()).toString(),
                                     element.getLocalPart(), msgRef);
                     }else{
                         attrName=element.getLocalPart();
                     }
                     OMUtils.printAttribute(Constants.ATTR_ELEMENT, attrName, pw);
                 } else {
                     //qtu is a Token
                     OMUtils.printAttribute(Constants.ATTR_ELEMENT, qtu.getToken(), pw);
                 }
             }
             printExtensibilityAttributes(msgRef.getExtensionAttributes(), msgRef, pw);
             pw.println('>');
             printDocumentation(msgRef.getDocumentationElements(), des, pw);
             printExtensibilityElements(msgRef.getClass(), msgRef.getExtensionElements(), des, pw);
             pw.println("    </" + tagName + '>');
         }
       }    
     
         
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.InterfaceMessageReferenceElement

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.