Examples of JAFDataHandlerSerializerFactory


Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        if (!encoded) {
            registerSOAPTypes();
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */

        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());
        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // SOAP Encoded strings are treated as primitives.
        // Everything else is not.
        myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class);
        myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class);
        myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class);
        myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class);

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64)
        );
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */

        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());
        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT), false);
        }

        // SOAP Encoded strings are treated as primitives.
        // Everything else is not.
        // Note that only deserializing is supported since we are flowing
        // SOAP 1.1 over the wire.
        myRegister(Constants.SOAP_STRING,     java.lang.String.class,
                   null, null, true);
        myRegister(Constants.SOAP_BOOLEAN,    java.lang.Boolean.class,
                   null, null, false);
        myRegister(Constants.SOAP_DOUBLE,     java.lang.Double.class,
                   null, null, false);
        myRegister(Constants.SOAP_FLOAT,      java.lang.Float.class,
                   null, null, false);
        myRegister(Constants.SOAP_INT,        java.lang.Integer.class,
                   null, null, false);
        myRegister(Constants.SOAP_INTEGER,    java.math.BigInteger.class,
                   null, null, false);
        myRegister(Constants.SOAP_DECIMAL,    java.math.BigDecimal.class,
                   null, null, false);
        myRegister(Constants.SOAP_LONG,       java.lang.Long.class,
                   null, null, false);
        myRegister(Constants.SOAP_SHORT,      java.lang.Short.class,
                   null, null, false);
        myRegister(Constants.SOAP_BYTE,       java.lang.Byte.class,
                   null, null, false);

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),true);
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),true);

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null,
                   false);

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */

        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegister(Constants.XSD_STRING,     java.lang.String.class,
                   null, null, true);
        myRegister(Constants.XSD_BOOLEAN,    java.lang.Boolean.class,
                   null, null, true);
        myRegister(Constants.XSD_DOUBLE,     java.lang.Double.class,
                   null, null, true);
        myRegister(Constants.XSD_FLOAT,      java.lang.Float.class,
                   null, null, true);
        myRegister(Constants.XSD_INT,        java.lang.Integer.class,
                   null, null, true);
        myRegister(Constants.XSD_INTEGER,    java.math.BigInteger.class,
                   null, null, true);
        myRegister(Constants.XSD_DECIMAL,    java.math.BigDecimal.class,
                   null, null, true);
        myRegister(Constants.XSD_LONG,       java.lang.Long.class,
                   null, null, true);
        myRegister(Constants.XSD_SHORT,      java.lang.Short.class,
                   null, null, true);
        myRegister(Constants.XSD_BYTE,       java.lang.Byte.class,
                   null, null, true);

        // The XSD Primitives are mapped to java primitives.
        myRegister(Constants.XSD_BOOLEAN,    boolean.class,
                   null, null,true);
        myRegister(Constants.XSD_DOUBLE,     double.class,
                   null, null,true);
        myRegister(Constants.XSD_FLOAT,      float.class,
                   null, null,true);
        myRegister(Constants.XSD_INT,        int.class,
                   null, null,true);
        myRegister(Constants.XSD_LONG,       long.class,
                   null, null,true);
        myRegister(Constants.XSD_SHORT,      short.class,
                   null, null,true);
        myRegister(Constants.XSD_BYTE,       byte.class,
                   null, null,true);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
                   true);

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null, false);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE),
                   true);

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME),
                   true);
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   true);
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   true);
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   true);
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_YEARMONTH),
                   true);
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimplePrimitiveSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   true);

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP),
                   false);
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null,  // Make sure not to override the deser mapping
                   false);
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null,  // Make sure not to override the deser mapping
                   false);

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory(), false);
        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR),
                   false);

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE), false);
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART), false);
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE), false);
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory(), false);
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */
        // anySimpleType is mapped to java.lang.String according to JAX-RPC 1.1 spec.
        myRegisterSimple(Constants.XSD_ANYSIMPLETYPE, java.lang.String.class);
       
        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        if (!encoded) {
            registerSOAPTypes();
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */

        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());
        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */
        // anySimpleType is mapped to java.lang.String according to JAX-RPC 1.1 spec.
        myRegisterSimple(Constants.XSD_ANYSIMPLETYPE, java.lang.String.class);
       
        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));

        // anySimpleType is mapped to java.lang.String according to JAX-RPC 1.1 spec.
        myRegisterSimple(Constants.XSD_ANYSIMPLETYPE, java.lang.String.class);
       
        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // Order counts here, HashMap should be last.
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */
        // anySimpleType is mapped to java.lang.String according to JAX-RPC 1.1 spec.
        myRegisterSimple(Constants.XSD_ANYSIMPLETYPE, java.lang.String.class);
       
        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // Order counts here, HashMap should be last.
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        if (!encoded) {
            registerSOAPTypes();
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */

        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.class,
View Full Code Here

Examples of org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

        // Since the last-registered type wins, I want to add the mime
        // String FIRST.
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_PLAINTEXT, java.lang.String.class,
                    new JAFDataHandlerSerializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT),
                    new JAFDataHandlerDeserializerFactory(
                            java.lang.String.class,
                            Constants.MIME_PLAINTEXT));
        }

        // HexBinary binary data needs to use the hex binary serializer/deserializer
        myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
                   new HexSerializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        HexBinary.class, Constants.XSD_HEXBIN));
        myRegister(Constants.XSD_HEXBIN,     byte[].class,
                   new HexSerializerFactory(
                        byte[].class, Constants.XSD_HEXBIN),
                   new HexDeserializerFactory(
                        byte[].class, Constants.XSD_HEXBIN));

        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // Special case:
        // If serialization is requested for xsd:byte with byte[],
        // the array serializer is used.  If deserialization
        // is specifically requested for xsd:byte with byte[], the
        // simple deserializer is used.  This is necessary
        // to support the serialization/deserialization
        // of <element name="a" type="xsd:byte" maxOccurs="unbounded" />
        // as discrete bytes without interference with XSD_BASE64.
        myRegister(Constants.XSD_BYTE,       byte[].class,
                   new ArraySerializerFactory(),
                   null
        );

        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64));
        /*
        // This JSR 101 change occurred right before v1.0.
        // This mapping is not roundtrippable, and breaks the roundtrip
        // testcase, so it is commented out for now.
        // SOAP 1.1
        // byte[] -ser-> XSD_BASE64
        // Byte[] -ser-> XSD_BASE64
        // XSD_BASE64 -deser-> byte[]
        // SOAP_BASE64 -deser->byte[]
        //
        // NOTE: If the following code is enabled, the
        // commented out code "//type == Byte[].class ||"
        // code in org.apache.axis.wsdl.fromJava.Types also needs to be enabled.

        myRegister(Constants.SOAP_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.SOAP_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                                 Constants.SOAP_BASE64),
                   true);
        myRegister(Constants.XSD_BASE64,     Byte[].class,
                   new Base64SerializerFactory(Byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(Byte[].class,
                                           Constants.XSD_BASE64),true);
        myRegister(Constants.XSD_BASE64,     byte[].class,
                   new Base64SerializerFactory(byte[].class,
                                               Constants.XSD_BASE64 ),
                   new Base64DeserializerFactory(byte[].class,
                                           Constants.XSD_BASE64),true);
        */
        // anySimpleType is mapped to java.lang.String according to JAX-RPC 1.1 spec.
        myRegisterSimple(Constants.XSD_ANYSIMPLETYPE, java.lang.String.class);
       
        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
        myRegisterSimple(Constants.XSD_STRING, java.lang.String.class);
        myRegisterSimple(Constants.XSD_BOOLEAN, java.lang.Boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, java.lang.Double.class);
        myRegisterSimple(Constants.XSD_FLOAT, java.lang.Float.class);
        myRegisterSimple(Constants.XSD_INT, java.lang.Integer.class);
        myRegisterSimple(Constants.XSD_INTEGER, java.math.BigInteger.class
        );
        myRegisterSimple(Constants.XSD_DECIMAL, java.math.BigDecimal.class
        );
        myRegisterSimple(Constants.XSD_LONG, java.lang.Long.class);
        myRegisterSimple(Constants.XSD_SHORT, java.lang.Short.class);
        myRegisterSimple(Constants.XSD_BYTE, java.lang.Byte.class);

        // The XSD Primitives are mapped to java primitives.
        myRegisterSimple(Constants.XSD_BOOLEAN, boolean.class);
        myRegisterSimple(Constants.XSD_DOUBLE, double.class);
        myRegisterSimple(Constants.XSD_FLOAT, float.class);
        myRegisterSimple(Constants.XSD_INT, int.class);
        myRegisterSimple(Constants.XSD_LONG, long.class);
        myRegisterSimple(Constants.XSD_SHORT, short.class);
        myRegisterSimple(Constants.XSD_BYTE, byte.class);

        // Map QNAME to the jax rpc QName class
        myRegister(Constants.XSD_QNAME,
              javax.xml.namespace.QName.class,
              new QNameSerializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME),
              new QNameDeserializerFactory(javax.xml.namespace.QName.class,
                                        Constants.XSD_QNAME)
        );

        // The closest match for anytype is Object
        myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                   null, null);

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.sql.Date.class,
                   new DateSerializerFactory(java.sql.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.sql.Date.class,
                                               Constants.XSD_DATE)
        );

        // See the SchemaVersion classes for where the registration of
        // dateTime (for 2001) and timeInstant (for 1999 & 2000) happen.
        myRegister(Constants.XSD_DATE,       java.util.Date.class,
                   new DateSerializerFactory(java.util.Date.class,
                                             Constants.XSD_DATE),
                   new DateDeserializerFactory(java.util.Date.class,
                                               Constants.XSD_DATE)
        );

        // Mapping for xsd:time.  Map to Axis type Time
        myRegister(Constants.XSD_TIME,       org.apache.axis.types.Time.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Time.class,
                                             Constants.XSD_TIME),
                   new SimpleDeserializerFactory(org.apache.axis.types.Time.class,
                                               Constants.XSD_TIME)
        );
        // These are the g* types (gYearMonth, etc) which map to Axis types
        myRegister(Constants.XSD_YEARMONTH, org.apache.axis.types.YearMonth.class,
                   new SimpleSerializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.YearMonth.class,
                                             Constants.XSD_YEARMONTH)
        );
        myRegister(Constants.XSD_YEAR, org.apache.axis.types.Year.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR),
                   new SimpleDeserializerFactory(org.apache.axis.types.Year.class,
                                             Constants.XSD_YEAR)
        );
        myRegister(Constants.XSD_MONTH, org.apache.axis.types.Month.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH),
                   new SimpleDeserializerFactory(org.apache.axis.types.Month.class,
                                             Constants.XSD_MONTH)
        );
        myRegister(Constants.XSD_DAY, org.apache.axis.types.Day.class,
                   new SimpleSerializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.Day.class,
                                             Constants.XSD_DAY)
        );
        myRegister(Constants.XSD_MONTHDAY, org.apache.axis.types.MonthDay.class,
                   new SimpleSerializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY),
                   new SimpleDeserializerFactory(org.apache.axis.types.MonthDay.class,
                                             Constants.XSD_MONTHDAY)
        );

        // Serialize all extensions of Map to SOAP_MAP
        // The SOAP_MAP will be deserialized into a HashMap by default.
        myRegister(Constants.SOAP_MAP,       java.util.HashMap.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   new MapDeserializerFactory(java.util.HashMap.class,
                                              Constants.SOAP_MAP)
        );
        myRegister(Constants.SOAP_MAP,       java.util.Hashtable.class,
                   new MapSerializerFactory(java.util.Hashtable.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );
        myRegister(Constants.SOAP_MAP,       java.util.Map.class,
                   new MapSerializerFactory(java.util.Map.class,
                                            Constants.SOAP_MAP),
                   null  // Make sure not to override the deser mapping
        );

        // Use the Element Serializeration for elements
        myRegister(Constants.SOAP_ELEMENT,   org.w3c.dom.Element.class,
                   new ElementSerializerFactory(),
                   new ElementDeserializerFactory());

        // Use the Document Serializeration for Document's
        myRegister(Constants.SOAP_DOCUMENT,   org.w3c.dom.Document.class,
                   new DocumentSerializerFactory(),
                   new DocumentDeserializerFactory());

        myRegister(Constants.SOAP_VECTOR,    java.util.Vector.class,
                   new VectorSerializerFactory(java.util.Vector.class,
                                               Constants.SOAP_VECTOR),
                   new VectorDeserializerFactory(java.util.Vector.class,
                                                 Constants.SOAP_VECTOR)
        );

        // Register all the supported MIME types
        // (note that MIME_PLAINTEXT was registered near the top)
        if (JavaUtils.isAttachmentSupported()) {
            myRegister(Constants.MIME_IMAGE, java.awt.Image.class,
                    new JAFDataHandlerSerializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE),
                    new JAFDataHandlerDeserializerFactory(
                            java.awt.Image.class,
                            Constants.MIME_IMAGE));
            myRegister(Constants.MIME_MULTIPART, javax.mail.internet.MimeMultipart.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART),
                    new JAFDataHandlerDeserializerFactory(
                            javax.mail.internet.MimeMultipart.class,
                            Constants.MIME_MULTIPART));
            myRegister(Constants.MIME_SOURCE, javax.xml.transform.Source.class,
                    new JAFDataHandlerSerializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE),
                    new JAFDataHandlerDeserializerFactory(
                            javax.xml.transform.Source.class,
                            Constants.MIME_SOURCE));
            myRegister(Constants.MIME_OCTETSTREAM, OctetStream.class,
                    new JAFDataHandlerSerializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM),
                    new JAFDataHandlerDeserializerFactory(
                            OctetStream.class,
                            Constants.MIME_OCTETSTREAM));
            myRegister(Constants.MIME_DATA_HANDLER, javax.activation.DataHandler.class,
                    new JAFDataHandlerSerializerFactory(),
                    new JAFDataHandlerDeserializerFactory());
        }

        // xsd:token
        myRegister(Constants.XSD_TOKEN, org.apache.axis.types.Token.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.