Examples of TypeMappingRegistry


Examples of org.apache.axis.encoding.TypeMappingRegistry

        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

Examples of org.apache.axis.encoding.TypeMappingRegistry

    {
        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

Examples of org.apache.axis.encoding.TypeMappingRegistry

    {
        category.debug("MessageContext: setServiceHandler("+sh+")");
        serviceHandler = sh;
        if (sh != null && sh instanceof SOAPService) {
            SOAPService service = (SOAPService)sh;
            TypeMappingRegistry tmr = service.getTypeMappingRegistry();
            setTypeMappingRegistry(tmr);
           
            if (serviceDesc == null) {
                serviceDesc = service.getServiceDescription();
            }
View Full Code Here

Examples of org.apache.axis.encoding.TypeMappingRegistry

                                    String url,
                                    String urn,
                                    String description,
                                    MessageContext msgContext) throws Exception
    {
        TypeMappingRegistry reg = msgContext.getTypeMappingRegistry();
        String name = cls.getName();
        name = name.substring(name.lastIndexOf('.') + 1);
        String serviceName = msgContext.getTargetService();
        if ((serviceName == null) || ("JWSProcessor".equals(serviceName)))
            serviceName = "";
View Full Code Here

Examples of org.apache.axis.encoding.TypeMappingRegistry

            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

Examples of org.apache.axis.encoding.TypeMappingRegistry

     * @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

Examples of org.apache.axis.encoding.TypeMappingRegistry

     * @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

Examples of org.apache.axis.encoding.TypeMappingRegistry

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

Examples of org.apache.axis.encoding.TypeMappingRegistry

            // NOTE : We don't check params.isEmpty() here because we
            //        must have added at least one above...
            //
            if (type==null && defaultParamTypes!=null &&
                params.size()<=defaultParamTypes.length) {
                TypeMappingRegistry typeMap = context.getTypeMappingRegistry();
                int index = params.size()-1;
                if (index+1<defaultParamTypes.length)
                    if (defaultParamTypes[0]==MessageContext.class) index++;
                type = typeMap.getTypeQName(defaultParamTypes[index]);
                if (DEBUG_LOG) {
                    System.err.println("Type from default parms was " + type);
                }
            }
        }
View Full Code Here

Examples of org.apache.axis.encoding.TypeMappingRegistry

    }

    public TypeMapping getTypeMapping()
    {
        // Get the TypeMappingRegistry
        TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();

        // If a TypeMapping is not available, add one.
        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(getEncodingStyle());
        TypeMapping defaultTM = (TypeMapping) tmr.getDefaultTypeMapping();
        if (tm == null || tm == defaultTM ) {
            tm = (TypeMapping) tmr.createTypeMapping();
            tm.setSupportedEncodings(new String[] {getEncodingStyle()});
            tmr.register(getEncodingStyle(), tm);
        }
        return tm;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.