Package javax.xml.rpc.namespace

Examples of javax.xml.rpc.namespace.QName


        if (namespaceMappings != null && !namespaceMappings.isEmpty()) {
            // If we have a default namespace mapping, require callers to
            // use that namespace.
            defaultNS = (String)namespaceMappings.get(0);
        }
        operation.setElementQName(new QName(defaultNS, method.getName()));
        operation.setMethod(method);
        Class retClass = method.getReturnType();
        operation.setReturnClass(retClass);
        operation.setReturnType(tm.getTypeQName(method.getReturnType()));

        Class [] paramTypes = method.getParameterTypes();
        String [] paramNames =
                ExtractorFactory.getExtractor().getParameterNamesFromDebugInfo(method);

        for (int k = 0; k < paramTypes.length; k++) {
            Class type = paramTypes[k];
            ParameterDesc paramDesc = new ParameterDesc();
            // If we have a name for this param, use it, otherwise call
            // it "in*"
            if (paramNames != null) {
                paramDesc.setName(paramNames[k+1]);
            } else {
                paramDesc.setName("in" + k);
            }
            paramDesc.setJavaType(type);

            // If it's a Holder, mark it INOUT and set the type to the
            // held type.  Otherwise it's IN with its own type.

            Class heldClass = JavaUtils.getHolderValueType(type);
            if (heldClass != null) {
                paramDesc.setMode(ParameterDesc.INOUT);
                paramDesc.setTypeQName(tm.getTypeQName(heldClass));
            } else {
                paramDesc.setMode(ParameterDesc.IN);
                paramDesc.setTypeQName(tm.getTypeQName(type));
            }
            operation.addParameter(paramDesc);
        }

        // Create Exception Types
        Class[] exceptionTypes = new Class[method.getExceptionTypes().length];
        exceptionTypes = method.getExceptionTypes();

        for (int i=0; i < exceptionTypes.length; i++) {
            // Every remote method declares a java.rmi.RemoteException
            if (exceptionTypes[i] != java.rmi.RemoteException.class) {
                Field[] f = exceptionTypes[i].getDeclaredFields();
                ArrayList exceptionParams = new ArrayList();
                for (int j = 0; j < f.length; j++) {
                    int mod = f[j].getModifiers();
                    if (Modifier.isPublic(mod) &&
                         !Modifier.isStatic(mod)) {
                        QName qname = new QName("", f[j].getName());
                        QName typeQName = tm.getTypeQName(f[j].getType());
                        ParameterDesc param = new ParameterDesc(qname,
                                                                ParameterDesc.IN,
                                                                typeQName);
                        param.setJavaType(f[j].getType());
                        exceptionParams.add(param);
View Full Code Here


     * @param namespace a namespace URI
     * @return an instance of the appropriate Service, or null
     */
    public SOAPService getServiceByNamespaceURI(String namespace)
            throws ConfigurationException {
        SOAPService service = (SOAPService)services.get(new QName("",namespace));
        if ((service == null) && (defaultConfiguration != null))
            service = defaultConfiguration.getServiceByNamespaceURI(namespace);
        return service;
    }
View Full Code Here

        service.setEngine(engine);
    }

    public void deployService(String name, SOAPService service)
    {
        deployService(new QName(null, name), service);
    }
View Full Code Here

    {
        if (qNameAttrs == null)
            qNameAttrs = new Vector();

        QNameAttr attr = new QNameAttr();
        attr.name = new QName(namespace, localName);
        attr.value = value;

        qNameAttrs.addElement(attr);
        // !!! Add attribute to attributes!
    }
View Full Code Here

        transports.put(qname, transport);
    }

    public void deployTransport(String name, Handler transport)
    {
        deployTransport(new QName(null, name), transport);
    }
View Full Code Here

        // Turn QName attributes into strings
        if (qNameAttrs != null) {
            for (int i = 0; i < qNameAttrs.size(); i++) {
                QNameAttr attr = (QNameAttr)qNameAttrs.get(i);
                QName attrName = attr.name;
                addAttribute(attrName.getNamespaceURI(),
                             attrName.getLocalPart(),
                             context.qName2String(attr.value));
            }
            qNameAttrs = null;
        }
       
View Full Code Here

        if (prefix != null)
            context.registerPrefixForURI(prefix, namespaceURI);

        if (objectValue != null) {
            context.serialize(new QName(namespaceURI, name),
                              attributes,
                              objectValue,
                              objectValue.getClass());
            return;
        }

        context.startElement(new QName(namespaceURI, name), attributes);
        if (children != null) {
            for (Iterator it = children.iterator(); it.hasNext();) {
                ((MessageElement)it.next()).output(context);
            }
        }
View Full Code Here

        throws SAXException
    {
        // If I'm the base class, try replacing myself with an
        // appropriate deserializer gleaned from type info.
        if (this.getClass().equals(DeserializerImpl.class)) {
            QName type = context.getTypeFromAttributes(namespace,
                                                       localName,
                                                       attributes);
            // If no type is specified, use the defaultType if available.
            // xsd:string is used if no type is provided.
            if (type == null) {
View Full Code Here

     * Write this element out to a SerializationContext
     */
    public void writeToContext(SerializationContext context)
            throws IOException {
        AttributesImpl attrs = new AttributesImpl();
        QName name = getQName();
        if (name != null) {
            attrs.addAttribute("", "name", "name",
                               "CDATA", context.qName2String(name));
        }
        if (providerQName != null) {
            attrs.addAttribute("", "provider", "provider",
                               "CDATA", context.qName2String(providerQName));
        }
        if (style != ServiceDesc.STYLE_RPC) {
            attrs.addAttribute("", "style", "style",
                               "CDATA", MessageContext.getStyleFromInt(style));
        }

        context.startElement(WSDDConstants.SERVICE_QNAME, attrs);

        if (desc.getWSDLFile() != null) {
            context.startElement(WSDL_QNAME, null);
            context.writeSafeString(desc.getWSDLFile());
            context.endElement();
        }

        for (int i = 0; i < operations.size(); i++) {
            WSDDOperation operation = (WSDDOperation) operations.elementAt(i);
            operation.writeToContext(context);
        }
        writeFlowsToContext(context);
        writeParamsToContext(context);


        for (int i=0; i < typeMappings.size(); i++) {
            ((WSDDTypeMapping) typeMappings.elementAt(i)).writeToContext(context);
        }

        for (int i=0; i < namespaces.size(); i++ ) {
            context.startElement(new QName(WSDDConstants.WSDD_NS, "namespace"),
                                 null);
            context.writeString((String)namespaces.get(i));
            context.endElement();
        }

View Full Code Here

        TypeMappingRegistry tmr = server.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.createTypeMapping();
        tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
        tmr.register(Constants.URI_CURRENT_SOAP_ENC, tm);
        tm.register(java.lang.String[].class,
                    new QName("urn:me", "ArrayOfString"),
                    new org.apache.axis.encoding.ser.ArraySerializerFactory(),
                    new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
        tm.register(java.lang.Object[].class,
                    new QName("urn:me", "ArrayOfObject"),
                    new org.apache.axis.encoding.ser.ArraySerializerFactory(),
                    new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
        tm.register(samples.echo.SOAPStruct.class,
                    new QName("urn:me", "SOAPStruct"),
                    new org.apache.axis.encoding.ser.BeanSerializerFactory(
                          samples.echo.SOAPStruct.class,
                          new QName("urn:me", "SOAPStruct")),
                    new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                          samples.echo.SOAPStruct.class,
                          new QName("urn:me", "SOAPStruct")));
        tm.register(samples.echo.SOAPStruct[].class,
                    new QName("urn:me", "ArrayOfSOAPStruct"),
                    new org.apache.axis.encoding.ser.ArraySerializerFactory(),
                    new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
        tm.register(samples.echo.SOAPStructStruct.class,
                    new QName("urn:me", "SOAPStructStruct"),
                    new org.apache.axis.encoding.ser.BeanSerializerFactory(
                          samples.echo.SOAPStructStruct.class,
                          new QName("urn:me", "SOAPStructStruct")),
                    new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                          samples.echo.SOAPStructStruct.class,
                          new QName("urn:me", "SOAPStructStruct")));
    }
View Full Code Here

TOP

Related Classes of javax.xml.rpc.namespace.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.