I am trying to persist the value in a text column in  a database.
I am using XmlSerializer to serialize it, but I dont see any output.
I have enclosed the code which does this. ost.size() turns out to be zero.

                        org.apache.axis.encoding.Serializer s = ValueType.getSerializer("", ValueType.class, ValueType.getTypeDesc().getXmlType());
                       
                        MessageContext mctx = new MessageContext(context.getEngine());
                        mctx.setEncodingStyle("UTF-8");
                        System.out.println("enc style " + mctx.getEncodingStyle());
                        byte buf[] = new byte[4096];
                        ByteArrayOutputStream ost = new ByteArrayOutputStream(4096);
                        SerializationContext ctx = new SerializationContextImpl(new OutputStreamWriter(ost), mctx);
                        System.out.println("ctx " + ctx);
                        s.serialize(ValueType.getTypeDesc().getXmlType(), null, value, ctx);
                        System.out.println("buf " + ost.size());


Regards,
- kiru

Reply via email to