Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.TypeMappingRegistry


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

        TypeMappingRegistry tmr = server.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.createTypeMapping();
        tm.setSupportedEncodings(new String[]{Constants.URI_DEFAULT_SOAP_ENC});
        tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
        tm.register(test.encoding.beans.SbTravelRequest.class,
                new QName("http://www.sidestep.com/sbws", "SbTravelRequest"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.encoding.beans.SbTravelRequest.class,
                        new QName("http://www.sidestep.com/sbws", "SbTravelRequest")),
View Full Code Here


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

        TypeMappingRegistry tmr = server.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) tmr.createTypeMapping();
        tm.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        tmr.register(Constants.URI_DEFAULT_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

        }
    }

    public TypeMappingRegistry getTypeMappingRegistry()
    {
        TypeMappingRegistry tmr = null;
        try {
            tmr = config.getTypeMappingRegistry();
        } catch (ConfigurationException e) {
            log.error(JavaUtils.getMessage("axisConfigurationException00"), e);
        }
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());

            // styles are not "soap version aware" so compensate...
            setEncodingStyle(service.getStyle().getEncoding());
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_DEFAULT_SOAP_ENC);
        if (tm == null || tm == tmr.getDefaultTypeMapping()) {
            tm = (TypeMapping) tmr.createTypeMapping();
            tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
        }
        tm.register(javaType, xmlType, sf, df);

        ServiceDesc desc = new ServiceDesc();
        desc.loadServiceDescByIntrospection(Service.class, tm);
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.setSupportedEncodings(new String[]{Constants.URI_DEFAULT_SOAP_ENC});
        tmr.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
        tm.register(test.encoding.beans.SbTravelRequest.class,
                new QName("http://www.sidestep.com/sbws", "SbTravelRequest"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.encoding.beans.SbTravelRequest.class,
                        new QName("http://www.sidestep.com/sbws", "SbTravelRequest")),
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.setSupportedEncodings(new String[] {Constants.URI_DEFAULT_SOAP_ENC});
        reg.register(Constants.URI_DEFAULT_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

        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

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

        QName beanQName = new QName("typeNS", "Bean");
        tm.register(SimpleBean.class,
                    beanQName,
                    new SimpleNonPrimitiveSerializerFactory(SimpleBean.class, beanQName),
View Full Code Here

        assertTrue(result.getQueryType().getNamespaceURI().equals("urn:QueryType"));
        assertTrue(result.getQueryType().getLocalPart().equals("BookQuery"));
    }

    private void addDynamicTypeMappings(AxisEngine engine) throws Exception {
        TypeMappingRegistry registry = engine.getTypeMappingRegistry();
        TypeMapping mapping = registry.createTypeMapping();
        addBeanMapping(mapping, "FindBooksQueryExpressionElement", FindBooksQueryExpressionElement.class);
        addBeanMapping(mapping, "BookType", BookType.class);
        addBeanMapping(mapping, "resultList", ResultListType.class);
        addBeanMapping(mapping, "QueryResultType", QueryResultType.class);
        addBeanMapping(mapping, "QueryResultElement", QueryResultElement.class);
        registry.register("",mapping);
        EngineConfiguration config = engine.getConfig();
        config.writeEngineConfig(engine);
    }
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.