Package org.apache.axis.encoding

Examples of org.apache.axis.encoding.TypeMapping


        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");
        reverse.setOption("allowedMethods", "*");
 
View Full Code Here


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

        String msgString = stringWriter.toString();
View Full Code Here

     * @param parameterMode one of IN, OUT or INOUT
     */
    public void addParameter(QName paramName, QName xmlType,
            ParameterMode parameterMode) {
        Class javaType = null;
        TypeMapping tm = getTypeMapping();
        if (tm != null) {
            javaType = tm.getClassForQName(xmlType);
        }
        addParameter(paramName, xmlType, javaType, parameterMode);
    }
View Full Code Here

     * @param parameterMode  one of IN, OUT or INOUT
     */
    public void addParameter(String paramName, QName xmlType,
            ParameterMode parameterMode) {
        Class javaType = null;
        TypeMapping tm = getTypeMapping();
        if (tm != null) {
            javaType = tm.getClassForQName(xmlType);
        }
        addParameter(new QName("", paramName), xmlType,
                     javaType, parameterMode);
    }
View Full Code Here

        // parmAndRetReq==false.  This does not conflict with
        // JSR 101 which indicates an exception MAY be thrown.

        //if (parmAndRetReq) {
        operation.setReturnType(type);
        TypeMapping tm = getTypeMapping();
        operation.setReturnClass(tm.getClassForQName(type));
        parmAndRetReq = true;
        //}
        //else {
        //throw new JAXRPCException(Messages.getMessage("noParmAndRetReq"));
        //}
View Full Code Here

        if (operation == null)
            operation = new OperationDesc();

        operation.setReturnClass(cls);
        TypeMapping tm = getTypeMapping();
        operation.setReturnType(tm.getTypeQName(cls));
        parmAndRetReq = true;
    }
View Full Code Here

     */
    public void registerTypeMapping(Class javaType, QName xmlType,
                                    SerializerFactory sf,
                                    DeserializerFactory df,
                                    boolean force) {
        TypeMapping tm = getTypeMapping();
        if (!force && tm.isRegistered(javaType, xmlType)) {
            return;
        }

        // Register the information
        tm.register(javaType, xmlType, sf, df);
    }
View Full Code Here

                    (BeanPropertyDescriptor) propertyMap.get(fieldName);
            if (bpd != null) {
                if (!bpd.isWriteable() || bpd.isIndexed() ) continue ;
               
                // determine the QName for this child element
                TypeMapping tm = context.getTypeMapping();
                Class type = bpd.getType();
                QName qn = tm.getTypeQName(type);
                if (qn == null)
                    throw new SAXException(
                            Messages.getMessage("unregistered00", type.toString()));
               
                // get the deserializer
View Full Code Here

        try {
            String encodingStyle = mapping.getEncodingStyle();
            if (encodingStyle == null) {
                encodingStyle = Constants.URI_DEFAULT_SOAP_ENC;
            }
            TypeMapping tm = tmr.getOrMakeTypeMapping(encodingStyle);

            SerializerFactory   ser   = null;
            DeserializerFactory deser = null;

            // Try to construct a serializerFactory by introspecting for the
            // following:
            // public static create(Class javaType, QName xmlType)
            // public <constructor>(Class javaType, QName xmlType)
            // public <constructor>()
            //
            // The BaseSerializerFactory createFactory() method is a utility
            // that does this for us.
            //log.debug("start creating sf and df");
            if (mapping.getSerializerName() != null &&
                !mapping.getSerializerName().equals("")) {
                ser = BaseSerializerFactory.createFactory(mapping.getSerializer(),
                                                          mapping.getLanguageSpecificType(),
                                                          mapping.getQName());
            }
            //log.debug("set ser factory");

            if (mapping.getDeserializerName() != null &&
                !mapping.getDeserializerName().equals("")) {
                deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(),
                                                          mapping.getLanguageSpecificType(),
                                                          mapping.getQName());
            }
            //log.debug("set dser factory");
            tm.register( mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser);
            //log.debug("registered");
        } catch (ClassNotFoundException e) {
            log.error(Messages.getMessage("unabletoDeployTypemapping00", mapping.getQName().toString()), e);
            throw new WSDDNonFatalException(e);
        } catch (Exception e) {
View Full Code Here

        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")),
                new org.apache.axis.encoding.ser.BeanDeserializerFactory(
                        test.encoding.beans.SbTravelRequest.class,
                        new QName("http://www.sidestep.com/sbws", "SbTravelRequest")));
        tm.register(test.encoding.beans.SbSupplier.class,
                new QName("http://www.sidestep.com/sbws", "SbSupplier"),
                new org.apache.axis.encoding.ser.BeanSerializerFactory(
                        test.encoding.beans.SbSupplier.class,
                        new QName("http://www.sidestep.com/sbws", "SbSupplier")),
                new org.apache.axis.encoding.ser.BeanDeserializerFactory(
View Full Code Here

TOP

Related Classes of org.apache.axis.encoding.TypeMapping

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.