Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.TypeMappingRegistry


        footer =
                "</methodResult>\n" +
              "</soap:Body>\n" +
            "</soap:Envelope>\n";

        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,
View Full Code Here


        log.debug("MessageContext: setServiceHandler("+sh+")");
        serviceHandler = sh;
        if (sh != null) {
            targetService = sh.getName();
            SOAPService service = (SOAPService)sh;
            TypeMappingRegistry tmr = service.getTypeMappingRegistry();
            setTypeMappingRegistry(tmr);
            setOperationStyle(service.getStyle());
            setEncodingStyle((service.getStyle() == ServiceDesc.STYLE_RPC) ?
                                        Constants.URI_CURRENT_SOAP_ENC : "");
View Full Code Here

        }
    }

    public TypeMappingRegistry getTypeMappingRegistry()
    {
        TypeMappingRegistry tmr = null;
        try {
            tmr = config.getTypeMappingRegistry();
        } catch (ConfigurationException e) {
            log.error(JavaUtils.getMessage("axisConfigurationException00"), e);
        }
View Full Code Here

            "<SOAP-ENV:Body>\n";
        footer =
            "</SOAP-ENV:Body>\n"+
            "</SOAP-ENV:Envelope>\n";

        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(test.encoding.RETURN.class,
                new QName("urn:test.encoding", "RETURN"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.encoding.RETURN.class,
                        new QName("urn:test.encoding", "RETURN")),
View Full Code Here

                Constants.URI_CURRENT_SCHEMA_XSD);
    }

    public TestRoundTrip(String name, String NS_XSI, String NS_XSD) {
        super(name);
        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(test.encoding.RETURN.class,
                new QName("urn:test.encoding", "RETURN"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.encoding.RETURN.class,
                        new QName("urn:test.encoding", "RETURN")),
View Full Code Here

        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(multiref);
       
        // Create a TypeMapping and register the specialized Type Mapping
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
        reg.register(Constants.URI_CURRENT_SOAP_ENC, tm);

        QName dataQName = new QName("typeNS", "Data");
        tm.register(Data.class, dataQName, new DataSerFactory(), new DataDeserFactory());

        msg.output(context);
View Full Code Here

        Class javaType = Data.class;
        QName xmlType = new QName("urn:foo", "Data");
        BeanSerializerFactory   sf = new BeanSerializerFactory(javaType, xmlType);
        BeanDeserializerFactory df = new BeanDeserializerFactory(javaType, xmlType);

        TypeMappingRegistry tmr = engine.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(Constants.URI_CURRENT_SOAP_ENC);
        if (tm == null || tm == tmr.getDefaultTypeMapping()) {
            tm = (TypeMapping) tmr.createTypeMapping();
            tmr.register(Constants.URI_CURRENT_SOAP_ENC, tm);
        }
        tm.register(javaType, xmlType, sf, df);

        ServiceDesc desc = new ServiceDesc();
        desc.loadServiceDescByIntrospection(Service.class, tm);
View Full Code Here

            }
        }
        //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,
View Full Code Here

            }
        }
        //register our type descriptors
        final Service service = ((ServiceImpl) serviceImpl).getService();
        final AxisEngine axisEngine = service.getEngine();
        final TypeMappingRegistry typeMappingRegistry = axisEngine.getTypeMappingRegistry();
        final 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 (final Iterator iter = typeInfo.iterator(); iter.hasNext(); ) {
            final TypeInfo info = (TypeInfo) iter.next();
View Full Code Here

        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        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.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);

        QName beanQName = new QName("typeNS", "TheBean");
        tm.register(AttributeBean.class,
                    beanQName,
                    new BeanSerializerFactory(AttributeBean.class, beanQName),
View Full Code Here

TOP

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

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.