Package javax.wsdl

Examples of javax.wsdl.QName


                                symbolTable,
                                portType.getQName().getNamespaceURI());
                    // prevent duplicates
                        if (! faultList.contains(name) ) {
                            faultList.add(name);
                            QName faultQName = new QName(
                                    portType.getQName().getNamespaceURI(),
                                    Utils.getExceptionName(f));
                            faults.put(f, faultQName)// add this fault to the list
                        }
                    }
View Full Code Here


                }
                else {
                    TypeEntry base = SchemaUtils.getComplexElementExtensionBase(
                       node, symbolTable);
                    if (base == null) {
                        QName baseQName = SchemaUtils.getSimpleTypeBase(
                           node, symbolTable);
                        if (baseQName != null) {
                            base = symbolTable.getType(baseQName);
                        }
                    }
View Full Code Here

                        dims += tEntry.getDimensions();
                        refType = tEntry.getRefType();
                    }
                   
                    // Get the QName to javify
                    QName typeQName = tEntry.getQName();
                    if ((typeQName.getLocalPart().indexOf(SymbolTable.ANON_TOKEN) >= 0) &&
                            (tEntry.getName() == null)) {
                        // This is an anonymous type name.
                        // Axis uses '>' as a nesting token to generate
                        // unique qnames for anonymous types.
                        // Only consider the localName after the last '>' when
                        // generating the java name
                        String localName = typeQName.getLocalPart();
                        localName =
                            localName.substring(
                                localName.lastIndexOf(SymbolTable.ANON_TOKEN)+1);
                        typeQName = new QName(typeQName.getNamespaceURI(), localName);
                        // If there is already an existing type, there will be a
                        // collision.  If there is an existing anon type, there will be a
                        // collision.  In both cases, the java type name should be mangled.
                        TypeEntry existing = symbolTable.getType(typeQName);
                        if (anonQNames.get(typeQName) != null ||
                                (existing != null &&
                                !(existing instanceof DefinedElement))) {
                            localName += "Type" + uniqueNum++;
                            typeQName = new QName(typeQName.getNamespaceURI(), localName);
                        }
                        anonQNames.put(typeQName, typeQName);
                        tEntry.setName(symbolTable.getJavaName(typeQName) + dims);
                    }
                    entry.setName(symbolTable.getJavaName(typeQName) + dims);
View Full Code Here

                    if (v.elementAt(0) instanceof Element) {
                        e = (Element)v.elementAt(0);
                    } else {
                        e = (Element)v.elementAt(1);
                    }
                    QName eType = Utils.getNodeTypeRefQName(e.getNode(), "type");
                    if (eType != null && eType.equals(e.getQName()))
                        resolve = false;
                }

                // Other Special Case:
                // If the names are already different, no mangling is needed.
                if (resolve) {
                    resolve = false// Assume false
                    String name = null;
                    for (int i = 0; i < v.size() && !resolve; ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                         if (entry instanceof MessageEntry ||
                             entry instanceof BindingEntry) {
                             ; // Don't process these
                         } else if (name== null) {
                             name = entry.getName();
                         } else if (name.equals(entry.getName())) {
                             resolve = true// Need to do resolution
                         }

                    }
                }

                // Full Mangle if resolution is necessary.
                if (resolve) {
                    boolean firstType = true;
                    for (int i = 0; i < v.size(); ++i) {
                        SymTabEntry entry = (SymTabEntry) v.elementAt(i);
                        if (entry instanceof Element) {
                            entry.setName(mangleName(entry.getName(),
                                    "_ElemType"));
                            // If this global element was defined using
                            // an anonymous type, then need to change the
                            // java name of the anonymous type to match.
                            QName anonQName = new QName(entry.getQName().getNamespaceURI(),
                                                        SymbolTable.ANON_TOKEN +
                                                        entry.getQName().getLocalPart());
                            TypeEntry anonType = symbolTable.getType(anonQName);
                            if (anonType != null) {
                                anonType.setName(entry.getName());
View Full Code Here

                                        JavaTypeWriter.HOLDER_IS_NEEDED,
                                        new Boolean(true));

                                // If the type is a DefinedElement, need to
                                // set HOLDER_IS_NEEDED on the anonymous type.
                                QName anonQName = SchemaUtils.
                                    getElementAnonQName(p.getType().getNode());
                                if (anonQName != null) {
                                    TypeEntry anonType =
                                        symbolTable.getType(anonQName);
                                    if (anonType != null) {
View Full Code Here

     */
    protected JavaDeployWriter(Emitter emitter,
                               Definition definition,
                               SymbolTable symbolTable) {
        super(emitter,
                new QName(definition.getTargetNamespace(), "deploy"),
                "",
                "wsdd",
                JavaUtils.getMessage("genDeploy00"), "deploy");
        this.definition = definition;
        this.symbolTable = symbolTable;
View Full Code Here

                // We pass "" as the namespace argument because we're just
                // interested in the return type for now.
                Parameters params =
                        symbolTable.getOperationParameters(operation, "", bEntry);
                if (params != null) {
                    QName elementQName = null;
                    QName returnQName = null;

                    // Get the operation qname
                    Input input = operation.getInput();
                    if (input != null) {
                        Map parts = input.getMessage().getParts();
                        if (parts != null && !parts.isEmpty()) {
                            Iterator i = parts.values().iterator();
                            Part p = (Part) i.next();
                            elementQName = p.getElementName();
                        }
                        if (elementQName == null) {
                            // FIXME - get namespace from WSDL?
                            elementQName = new QName("", operationName);
                        }
                        QName defaultQName = new QName("", javaOperName);
                        if (defaultQName.equals(elementQName)) {
                            elementQName = null;
                        }
                    }

                    // Get the operation's return QName
View Full Code Here

        Vector paramList = params.list;
        for (int i = 0; i < paramList.size(); i++) {
            Parameter param = (Parameter) paramList.elementAt(i);
            TypeEntry typeEntry = param.getType();

            QName paramQName = null;
            QName paramType = null;

            // Get the parameter type QName
            if (typeEntry instanceof DefinedElement) {
                paramType = typeEntry.getRefType().getQName();
            } else {
View Full Code Here

    /**
     * If the specified node represents a 'normal' non-enumeration simpleType,
     * the QName of the simpleType base is returned.
     */
    public static QName getSimpleTypeBase(Node node, SymbolTable symbolTable) {
        QName baseQName = null;

        if (node == null) {
            return null;
        }

        // If the node kind is an element, dive into it.
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            Node simpleNode = null;
            for (int j = 0; j < children.getLength() && simpleNode == null; j++) {
                QName simpleKind = Utils.getNodeQName(children.item(j));
                if (simpleKind != null &&
                    simpleKind.getLocalPart().equals("simpleType") &&
                    Constants.isSchemaXSD(simpleKind.getNamespaceURI())) {
                    simpleNode = children.item(j);
                    node = simpleNode;
                }
            }
        }
        // Get the node kind, expecting a schema simpleType
        nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("simpleType") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {

            // Under the simpleType there should be a restriction.
            // (There may be other #text nodes, which we will ignore).
            NodeList children = node.getChildNodes();
            Node restrictionNode = null;
            for (int j = 0; j < children.getLength() && restrictionNode == null; j++) {
                QName restrictionKind = Utils.getNodeQName(children.item(j));
                if (restrictionKind != null &&
                    restrictionKind.getLocalPart().equals("restriction") &&
                    Constants.isSchemaXSD(restrictionKind.getNamespaceURI()))
                    restrictionNode = children.item(j);
            }

            // The restriction node indicates the type being restricted
            // (the base attribute contains this type).
           
            if (restrictionNode != null) {
                baseQName = Utils.getNodeTypeRefQName(restrictionNode, "base");
            }
           
            // Look for enumeration elements underneath the restriction node
            if (baseQName != null && restrictionNode != null) {
                NodeList enums = restrictionNode.getChildNodes();
                for (int i=0; i < enums.getLength(); i++) {
                    QName enumKind = Utils.getNodeQName(enums.item(i));
                    if (enumKind != null &&
                        enumKind.getLocalPart().equals("enumeration") &&
                        Constants.isSchemaXSD(enumKind.getNamespaceURI())) {
                       
                        // Found an enumeration, this isn't a
                        // 'normal' simple type.
                        return null;
                    }
View Full Code Here

        if (node == null) {
            return re;
        }

        // If the node kind is an element, dive into it.
        QName nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            nodeKind.getLocalPart().equals("element") &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {
            NodeList children = node.getChildNodes();
            Node node2 = null;
            for (int j = 0; j < children.getLength() && node2 == null; j++) {
                QName kind2 = Utils.getNodeQName(children.item(j));
                if (kind2 != null &&
                    (kind2.getLocalPart().equals("simpleType") ||
                     kind2.getLocalPart().equals("complexType") ||
                     kind2.getLocalPart().equals("simpleContent")) &&
                    Constants.isSchemaXSD(kind2.getNamespaceURI())) {
                    node2 = children.item(j);
                    node = node2;
                }
            }
        }
        // Get the node kind, expecting a schema simpleType
        nodeKind = Utils.getNodeQName(node);
        if (nodeKind != null &&
            (nodeKind.getLocalPart().equals("simpleType") ||
             nodeKind.getLocalPart().equals("complexType")) &&
            Constants.isSchemaXSD(nodeKind.getNamespaceURI())) {

            // Under the complexType there could be a complexContent.
            NodeList children = node.getChildNodes();
            Node complexContent = null;
            Node extension = null;
            if (nodeKind.getLocalPart().equals("complexType")) {
                for (int j = 0; j < children.getLength() && complexContent == null; j++) {
                    QName complexContentKind = Utils.getNodeQName(children.item(j));
                    if (complexContentKind != null &&
                        (complexContentKind.getLocalPart().equals("complexContent") ||
                         complexContentKind.getLocalPart().equals("simpleContent"))&&
                        Constants.isSchemaXSD(complexContentKind.getNamespaceURI()))
                        complexContent = children.item(j);
                }
                node = complexContent;
            }
            // Now get the extension or restriction node
            if (node != null) {
                children = node.getChildNodes();
                for (int j = 0; j < children.getLength() && re == null; j++) {
                    QName reKind = Utils.getNodeQName(children.item(j));
                    if (reKind != null &&
                        (reKind.getLocalPart().equals("extension") ||
                         reKind.getLocalPart().equals("restriction")) &&
                        Constants.isSchemaXSD(reKind.getNamespaceURI()))
                        re = children.item(j);
                }
            }
        }
           
View Full Code Here

TOP

Related Classes of javax.wsdl.QName

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.