Examples of TypeMappingRegistry


Examples of org.apache.axis.encoding.TypeMappingRegistry

        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

Examples of org.apache.axis.encoding.TypeMappingRegistry

        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

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

Examples of org.apache.axis.encoding.TypeMappingRegistry

                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

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

Examples of org.apache.axis.encoding.TypeMappingRegistry

            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

Examples of org.apache.axis.encoding.TypeMappingRegistry

      Service service = new Service();
      MessageContext msgContext = new MessageContext(service.getEngine());
      msgContext.setResponseMessage(responseMessage);

      TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();
      org.apache.axis.encoding.TypeMapping tm =
        (org.apache.axis.encoding.TypeMapping) tmr.getTypeMapping(
          outputEncodingStyle);

          // register any default type mappings     
          registerDefaultTypeMappings(tm, getContext());
     
View Full Code Here

Examples of org.apache.axis.encoding.TypeMappingRegistry

         * created with all the options we set above.
         */
        ServiceDesc sd = service.getInitializedServiceDesc(null);
   
        // Tell Axis to try and be intelligent about serialization.
        TypeMappingRegistry registry = service.getTypeMappingRegistry();       
       
        TypeMappingImpl tm = (TypeMappingImpl) registry.getDefaultTypeMapping();
        //tm.setDoAutoTypes( true );
       
        // Tell the axis configuration about our new service.
        provider.deployService( serviceName, service );
    }
View Full Code Here

Examples of org.apache.axis.encoding.TypeMappingRegistry

            }
        }
        //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

Examples of org.apache.axis.encoding.TypeMappingRegistry

            }
        }
        //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
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.