Package org.apache.axis.encoding

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.
        return tmr.getOrMakeTypeMapping(getEncodingStyle());
    }
View Full Code Here


                                Constants.ATTR_ENCODING_STYLE);

            if (encodingStyle != null && !encodingStyle.equals("")
                && !encodingStyle.equals(Constants.URI_SOAP12_NOENC)
                && !Constants.isSOAP_ENC(encodingStyle)) {
                TypeMappingRegistry tmr = context.getTypeMappingRegistry();
                // TODO: both soap encoding style is registered ?
                if (tmr.getTypeMapping(encodingStyle) == tmr.getDefaultTypeMapping()) {
                    AxisFault fault = new AxisFault(Constants.FAULT_SOAP12_DATAENCODINGUNKNOWN,
                        null, Messages.getMessage("invalidEncodingStyle"), null, null, null);

                    throw new SAXException(fault);
                }
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 =
                tmr.getOrMakeTypeMapping(Constants.URI_DEFAULT_SOAP_ENC);
        tm.register(javaType, xmlType, sf, df);

        // Register the reverseString service
        SOAPService reverse = new SOAPService(new RPCProvider());
        reverse.setOption("className", "test.RPCDispatch.Service");
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_SOAP12_ENC});
        reg.register(Constants.URI_SOAP12_ENC, tm);

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

        msg.output(context);
View Full Code Here

    stringWriter = new StringWriter();
    MessageContext msgContext = new MessageContext(new AxisServer());
    context = new SerializationContextImpl(stringWriter, msgContext);

    // 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);

    tm.register(SuperBean.class, superTypeQName, new BeanSerializerFactory(SuperBean.class,superTypeQName), new BeanDeserializerFactory(SuperBean.class,superTypeQName));
    tm.register(DerivatedBean.class, inheritedTypeQName, new BeanSerializerFactory(DerivatedBean.class,inheritedTypeQName), new BeanDeserializerFactory(DerivatedBean.class,inheritedTypeQName));
  }
View Full Code Here

            "  </m:getDataOperationResponse>\n" +
            " </env:Body>\n" +
            "</env:Envelope>";

    public void testBug22213() throws Exception {
        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.wsdl.arrays2.data.DataType.class,
                new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.wsdl.arrays2.data.DataType.class,
                        new javax.xml.namespace.QName("http://www.xyz.net/schemas/arraytest/data/1.0", "dataType")),
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());
            setOperationUse(service.getUse());

            // styles are not "soap version aware" so compensate...
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.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

        }
    }

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