Package javax.wsdl

Examples of javax.wsdl.QName


    /**
     * Constructor.
     */
    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


            // registered.
            String localPart = type.getQName().getLocalPart();
            if (localPart.startsWith(SymbolTable.ANON_TOKEN)) {
                localPart = localPart.substring(1);
            }
            QName qName = new QName(type.getQName().getNamespaceURI(), localPart);

            if (process) {
                pw.println("      <typeMapping");
                pw.println("        xmlns:ns=\"" + qName.getNamespaceURI() + "\"");
                pw.println("        qname=\"ns:" + qName.getLocalPart() + '"');
                pw.println("        type=\"java:" + type.getName() + '"');
                if (type.getName().endsWith("[]")) {
                    pw.println("        serializer=\"org.apache.axis.encoding.ser.ArraySerializerFactory\"");
                    pw.println("        deserializer=\"org.apache.axis.encoding.ser.ArrayDeserializerFactory\"");
                } else if (type.getNode() != null &&
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.returnType instanceof DefinedElement) {
                QName returnQName = params.returnType.getQName();
                pw.println("      <operation name=\"" + operation.getName() +
                         "\" returnQName=\"retNS:" +
                         returnQName.getLocalPart() +
                         "\" xmlns:retNS=\"" +
                         returnQName.getNamespaceURI() +
                         "\">");

                // map doc/lit elements to this operation
                Map parts = operation.getInput().getMessage().getParts();
                if (!parts.isEmpty()) {
                    Iterator i = parts.values().iterator();
                    Part p = (Part) i.next();
                    QName elementQName = p.getElementName();
                    String ns = elementQName.getNamespaceURI();
                    pw.println("        <elementMapping xmlns:ns=\"" +
                            ns + "\" element=\"ns:" +
                            elementQName.getLocalPart() + "\"/>");
                }

                pw.println("      </operation>");
            }
View Full Code Here

    }

    public void setName(String name) {
        this.name = name;
        if (qname == null)
            this.qname = new QName("", name);
    }
View Full Code Here

     *   So in these circumstances, this routine is called with xsd:int to
     *   get a suitable qname (soapenc:int) which maps to Integer.
     * @param QName
     */
    public static QName getNillableQName(QName qName) {
        QName rc = new QName(qName.getNamespaceURI(), qName.getLocalPart());
        if (Constants.isSchemaXSD(rc.getNamespaceURI())) {
            String localName = rc.getLocalPart();
            if (localName.equals("int") ||
                localName.equals("long") ||
                localName.equals("short") ||
                localName.equals("float") ||
                localName.equals("double") ||
                localName.equals("boolean") ||
                localName.equals("byte")) {
                rc.setNamespaceURI(Constants.URI_CURRENT_SOAP_ENC);
            }
            else if (localName.equals("base64Binary") ||
                     localName.equals("hexBinary")) {
                rc.setNamespaceURI(Constants.URI_CURRENT_SOAP_ENC);
                rc.setLocalPart("base64");
            }
        }
       return rc;
    }
View Full Code Here

        if (localName == null) {
            return null;
        }
        String namespace = node.getNamespaceURI();

        return (new QName(namespace, localName));
    }
View Full Code Here

        // First try to get the name directly
        localName = getAttribute(node, "name");
       
        // If this fails and the node has a ref, use the ref name.
        if (localName == null) {
            QName ref = getNodeTypeRefQName(node, "ref");
            if (ref != null) {
                localName = ref.getLocalPart();
                namespace = ref.getNamespaceURI();
            }
        }
       
        // This routine may be called for complexType elements.  In some cases,
        // the complexType may be anonymous, which is why the getScopedAttribute
        // method is used.
        if (localName == null) {
            localName = "";
            Node search = node.getParentNode();
            while(search != null) {
                QName kind = getNodeQName(search);
                if (kind.getLocalPart().equals("schema")) {
                    search = null;
                } else if (kind.getLocalPart().equals("element")) {
                    localName = SymbolTable.ANON_TOKEN +
                        getNodeNameQName(search).getLocalPart();
                    search = search.getParentNode();
                } else if (kind.getLocalPart().equals("complexType") ||
                           kind.getLocalPart().equals("simpleType")) {
                    localName = getNodeNameQName(search).getLocalPart() + localName;
                    search = null;
                } else {
                    search = search.getParentNode();
                }
            }           
        }
        if (localName == null)
            return null;

        // Build and return the QName
        if (namespace == null) {
            namespace = getScopedAttribute(node, "targetNamespace");
        }
        return (new QName(namespace, localName));
    }
View Full Code Here

        // If the node has "type" and "maxOccurs" then the type is really
        // a collection.  There is no qname in the wsdl which we can use to represent
        // the collection, so we need to invent one.
        // The local part of the qname is changed to <local>[minOccurs, maxOccurs]
        // The namespace uri is changed to the targetNamespace of this node
        QName qName= getNodeTypeRefQName(node, "type");
        if (qName != null) {
            String maxOccursValue = getAttribute(node, "maxOccurs");
            String minOccursValue = getAttribute(node, "minOccurs");
            if (maxOccursValue == null) {
                maxOccursValue = "1";
            }
            if (minOccursValue == null) {
                minOccursValue = "1";
            }
            if (minOccursValue.equals("0") && maxOccursValue.equals("1")) {
                // If we have a minoccurs="0"/maxoccurs="1", this is just
                // like a nillable single value, so treat it as such.
                qName = getNillableQName(qName);
            } else if (!maxOccursValue.equals("1") || !minOccursValue.equals("1")) {
                String localPart = qName.getLocalPart();
//                localPart += "[" + minOccursValue + "," + maxOccursValue + "]";
//                qName.setLocalPart(localPart);
//                String namespace = getScopedAttribute(node, "targetNamespace");
//                if (namespace != null)
//                    qName.setNamespaceURI(namespace);
                localPart += "[" + maxOccursValue + "]";
                qName.setLocalPart(localPart);
            }
        }

        // Both "ref" and "element" reference elements
        if (qName == null) {
View Full Code Here

        String prefixedName = getAttribute(node, typeAttrName);
        if (prefixedName == null) {
            return null;
        }
        // Change the prefixed name into a full qname
        QName qName = getQNameFromPrefixedName(node,prefixedName);

        // An alternate qname is returned if nillable
        if (typeAttrName.equals("type")) {
            String nillable = getAttribute(node, "nillable");
            if (nillable != null && nillable.equalsIgnoreCase("true")) {
View Full Code Here

           namespace = getScopedAttribute(node, "xmlns")// Get namespace for unqualified reference
        }
        else {
           namespace = getScopedAttribute(node, "xmlns:" + prefixedName.substring(0, prefixedName.lastIndexOf(":")));
        }
        return (new QName(namespace, localName));
    }
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.