Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.TypeMappingRegistry


        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, "ResultListType", 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


        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

                rpc.setOption(RPCProvider.OPTION_SCOPE, scope);
               
                // Set up service description
                ServiceDesc sd = rpc.getServiceDescription();
               
                TypeMappingRegistry tmr = msgContext.getAxisEngine().getTypeMappingRegistry();
                sd.setTypeMappingRegistry(tmr);
                sd.setTypeMapping(msgContext.getTypeMapping());
               
                rpc.getInitializedServiceDesc(msgContext);
               
View Full Code Here

            if (args.length == 0) {
                Writer stringWriter = new StringWriter();
                SerializationContext context = new SerializationContext(stringWriter, msgContext);

                TypeMappingRegistry reg = context.getTypeMappingRegistry();
                TypeMapping tm = (TypeMapping) reg.getTypeMapping(Constants.URI_SOAP11_ENC);
                if (tm == null) {
                    tm = (TypeMapping) reg.createTypeMapping();
                    reg.register(Constants.URI_DEFAULT_SOAP_ENC, tm);
                }
                tm.register(RequestSecurityTokenResponse.class, TrustConstants.RESPONSE_NAME, new RSTResponseSerializerFactory(), new RSTResponseDeserializerFactory());

                msg.output(context);
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

   
    /**
     * return the named mapping registry
     */
    public TypeMappingRegistry getTypeMappingRegistry(String encodingStyle) throws DeploymentException {
        TypeMappingRegistry tmr = (TypeMappingRegistry)mappings.get(encodingStyle);
        return tmr;
    }
View Full Code Here

            registry.deployItem(services[n]);
        }
       
        for (int n = 0; n < mappings.length; n++) {
            WSDDTypeMapping mapping = mappings[n];
            TypeMappingRegistry tmr = registry.getTypeMappingRegistry(mapping.getEncodingStyle());
            if (tmr == null) {
                tmr = new TypeMappingRegistry();
                registry.addTypeMappingRegistry(mapping.getEncodingStyle(), tmr);
            }

            Serializer ser = null;
            DeserializerFactory deser = null;
           
            try {
                ser = (Serializer)mapping.getSerializer().newInstance();
                deser = (DeserializerFactory)mapping.getDeserializer().newInstance();
            } catch (Exception e) {}
           
            try {
                if (ser != null)
                    tmr.addSerializer(mapping.getLanguageSpecificType(),
                                    mapping.getQName(), ser);
           
                if (deser != null)
                    tmr.addDeserializerFactory(mapping.getQName(),
                                               mapping.getLanguageSpecificType(),
                                               deser);
            } catch (Exception e) {
                throw new DeploymentException(e.getMessage());
            }
View Full Code Here

     * @param _class the Java class of the data type.
     * @param qName the xsi:type QName of the associated XML type.
     * @param serializer a Serializer which will be used to write the XML.
     */
    public void addSerializer(Class _class, QName qName, Serializer serializer) {
        TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
        typeMap.addSerializer(_class, qName, serializer);
    }
View Full Code Here

     * @param deserializerFactory a factory which can create deserializer
     *                            instances for this type.
     */
    public void addDeserializerFactory(QName qName, Class _class,
                                       DeserializerFactory deserializerFactory) {
        TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
        typeMap.addDeserializerFactory(qName, _class, deserializerFactory);
    }
View Full Code Here

    {
        if (context == null)
            throw new Exception(
             "No deserialization context to use in getValueAsType()!");
       
        TypeMappingRegistry tmr = context.getTypeMappingRegistry();
        Deserializer dser = tmr.getDeserializer(type);
        if (dser == null)
            throw new Exception("No deserializer for requested type " +
                                type);
       
        context.pushElementHandler(new EnvelopeHandler(dser));
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.