Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.TypeMapping


        }
        //register our type descriptors
        Service service = ((ServiceImpl) serviceImpl).getService();
        AxisEngine axisEngine = service.getEngine();
        TypeMappingRegistry typeMappingRegistry = axisEngine.getTypeMappingRegistry();
        TypeMapping typeMapping = typeMappingRegistry.getOrMakeTypeMapping(encodingStyle);
        typeMapping.register(BigInteger.class,
                Constants.XSD_UNSIGNEDLONG,
                new SimpleSerializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG),
                new SimpleDeserializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG));
        typeMapping.register(URI.class,
                Constants.XSD_ANYURI,
                new SimpleSerializerFactory(URI.class, Constants.XSD_ANYURI),
                new SimpleDeserializerFactory(URI.class, Constants.XSD_ANYURI));
        //It is essential that the types be registered before the typeInfos create the serializer/deserializers.
        for (Iterator iter = typeInfo.iterator(); iter.hasNext();) {
View Full Code Here


        }

        TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
        tmr.doRegisterFromVersion("1.3");

        TypeMapping typeMapping = tmr.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());

        serviceDesc.setTypeMappingRegistry(tmr);
        serviceDesc.setTypeMapping(typeMapping);

        List typeInfo;
View Full Code Here

        serviceDesc.setStyle(Style.RPC);
        serviceDesc.setUse(Use.ENCODED);

        TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
        tmr.doRegisterFromVersion("1.3");
        TypeMapping typeMapping = tmr.getOrMakeTypeMapping(serviceDesc.getUse().getEncoding());

        serviceDesc.setTypeMappingRegistry(tmr);
        serviceDesc.setTypeMapping(typeMapping);

        OperationDesc op = new OperationDesc();
        op.setName("echoString");
        op.setStyle(Style.RPC);
        op.setUse(Use.ENCODED);
        Class beanClass = EchoBean.class;
        op.setMethod(beanClass.getMethod("echoString", new Class[] { String.class }));
        ParameterDesc parameter =
            new ParameterDesc(
                new QName("http://ws.apache.org/echosample", "in0"),
                ParameterDesc.IN,
                typeMapping.getTypeQName(String.class),
                String.class,
                false,
                false);
        op.addParameter(parameter);
        serviceDesc.addOperationDesc(op);
View Full Code Here

        context.setDoMultiRefs(false)// no multirefs
        context.setPretty(false);

        // Create a TypeMapping and register the Bean serializer/deserializer
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        // The "" namespace is literal (no encoding).
        tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
        reg.register(Constants.URI_CURRENT_SOAP_ENC, tm);

        QName beanQName = new QName("typeNS", "TheBean");
        tm.register(AttributeBean.class,
                    beanQName,
                    new BeanSerializerFactory(AttributeBean.class, beanQName),
                    new BeanDeserializerFactory(AttributeBean.class, beanQName));

        // Serialize the bean in to XML
View Full Code Here

                                                                    msgContext);
        context.setDoMultiRefs(false);

        // Create a TypeMapping and register the Bean serializer/deserializer
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        // The "" namespace is literal (no encoding).
        tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
        reg.register(Constants.URI_CURRENT_SOAP_ENC, tm);

        QName beanQName = new QName("typeNS", "Bean");
        tm.register(SimpleBean.class,
                    beanQName,
                    new SimpleNonPrimitiveSerializerFactory(SimpleBean.class, beanQName),
                    new SimpleDeserializerFactory(SimpleBean.class, beanQName));

        // Serialize the bean in to XML
View Full Code Here

        // There may not be enough information yet to choose the
        // specific deserializer.
        if (dSer == null) {
            dSer = new DeserializerImpl();
            // determine a default type for this child element
            TypeMapping tm = context.getTypeMapping();
            Class type = propDesc.getType();
            dSer.setDefaultType(tm.getTypeQName(type));
        }
               
        if (propDesc.isWriteable()) {
            if (!propDesc.isIndexed()) {
                // Success!  Register the target and deserializer.
View Full Code Here

                    (BeanPropertyDescriptor) propertyMap.get(fieldName);
            if (bpd != null) {
                if (!bpd.isWriteable() || bpd.isIndexed() ) continue ;
               
                // determine the QName for this child element
                TypeMapping tm = context.getTypeMapping();
                Class type = bpd.getType();
                QName qn = tm.getTypeQName(type);
                if (qn == null)
                    throw new SAXException(
                            JavaUtils.getMessage("unregistered00", type.toString()));
               
                // get the deserializer
View Full Code Here

        try {
            String encodingStyle = mapping.getEncodingStyle();
            if (encodingStyle == null) {
                encodingStyle = Constants.URI_CURRENT_SOAP_ENC;
            }
            TypeMapping tm = (TypeMapping) tmr.getTypeMapping(encodingStyle);
            TypeMapping df = (TypeMapping) tmr.getDefaultTypeMapping();
            if (tm == null || tm == df) {
                tm = (TypeMapping) tmr.createTypeMapping();
                tm.setSupportedNamespaces(new String[] {encodingStyle});
                tmr.register(encodingStyle, tm);
            }
View Full Code Here

                        serviceDescription.setImplClass(cls);
                    } catch (ClassNotFoundException e) {
                        return null; // FIXME - throw?
                    }
                }
                TypeMapping tm;
                if (msgContext == null) {
                    tm = DefaultTypeMappingImpl.getSingleton();
                } else {
                    tm = msgContext.getTypeMapping();
                }
View Full Code Here

     * @param parameterMode  one of IN, OUT or INOUT
     */
    public void addParameter(QName paramName, QName xmlType,
            ParameterMode parameterMode) {
        Class javaType = null;
        TypeMapping tm = getTypeMapping();
        if (tm != null) {
            javaType = tm.getClassForQName(xmlType);
        }
        addParameter(paramName, xmlType, javaType, parameterMode);
    }
View Full Code Here

TOP

Related Classes of org.apache.axis.encoding.TypeMapping

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.